Skip to content

Commit

Permalink
chore: sveltin namespace added
Browse files Browse the repository at this point in the history
  • Loading branch information
indaco committed Apr 30, 2022
1 parent 4426d63 commit e63ca28
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 31 deletions.
26 changes: 3 additions & 23 deletions src/lib/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
export {};

declare global {
interface Window {
dataLayer: Array<any>;
dataLayer: object[];
}
}

export interface ExternalLinkItem {
identifier: string;
name: string;
url: string;
weight: number;
}

export interface Metadata {
name: string;
items: Array<MetadataItem>;
}

export interface MetadataItem {
title: string;
slug: string;
headline: string;
}

export interface DynamicObject {
[key: string]: any;
}
36 changes: 36 additions & 0 deletions src/sveltin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
declare namespace Sveltin {
export interface ContentEntry {
resource: string;
metadata: YAMLFrontmatter;
html?: string;
}

export interface ContentMetadata {
name: string;
items: Array<YAMLFrontmatter>;
}

export interface YAMLFrontmatter {
title: string;
slug: string;
draft: boolean;
headline: string;
headings: Array<TOCEntry>;
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<TOCEntry>;
}

export interface DynamicObject {
[key: string]: string | number | object | [];
}
}
27 changes: 19 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit e63ca28

Please sign in to comment.