diff --git a/src/lib/interfaces.ts b/src/lib/interfaces.ts index f4a2057..f64597a 100644 --- a/src/lib/interfaces.ts +++ b/src/lib/interfaces.ts @@ -1,27 +1,7 @@ +export {}; + declare global { interface Window { - dataLayer: Array; + dataLayer: object[]; } } - -export interface ExternalLinkItem { - identifier: string; - name: string; - url: string; - weight: number; -} - -export interface Metadata { - name: string; - items: Array; -} - -export interface MetadataItem { - title: string; - slug: string; - headline: string; -} - -export interface DynamicObject { - [key: string]: any; -} diff --git a/src/sveltin.d.ts b/src/sveltin.d.ts new file mode 100644 index 0000000..ed80e2f --- /dev/null +++ b/src/sveltin.d.ts @@ -0,0 +1,36 @@ +declare namespace Sveltin { + export interface ContentEntry { + resource: string; + metadata: YAMLFrontmatter; + html?: string; + } + + export interface ContentMetadata { + name: string; + items: Array; + } + + export interface YAMLFrontmatter { + title: string; + slug: string; + draft: boolean; + headline: string; + headings: Array; + author?: string; + created_at?: string; + updated_at?: string; + cover?: string; + [key: string]: string | number | object | []; + } + + export interface TOCEntry { + id: string; + title: string; + depth: number; + children?: Array; + } + + export interface DynamicObject { + [key: string]: string | number | object | []; + } +} diff --git a/tsconfig.json b/tsconfig.json index f57c3b2..2fad6d2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,27 @@ { "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es2020", "DOM"], + "moduleResolution": "node", + "module": "es2020", + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "target": "es2020", "outDir": "./build", "paths": { - "$lib": ["src/lib"], - "$lib/*": ["src/lib/*"], - "$config": ["config"], - "$config/*": ["config/*"], - "$content": ["content"], - "$content/*": ["content/*"], - "$themes": ["themes"], - "$themes/*": ["themes/*"] + "$lib": ["./src/lib"], + "$lib/*": ["./src/lib/*"], + "$config": ["./config"], + "$config/*": ["./config/*"], + "$content": ["./content"], + "$content/*": ["./content/*"], + "$themes": ["./themes"], + "$themes/*": ["./themes/*"] } }, "include": [