feat: add content typing

This commit is contained in:
kmacoders 2021-07-08 13:56:37 +07:00
parent 03071a29b2
commit ee6cbd3614
3 changed files with 32 additions and 0 deletions

10
types/content/index.ts Normal file
View File

@ -0,0 +1,10 @@
import { IContentDocument } from '@nuxt/content/types/content'
export interface INavLink {
category: string,
contentDocuments: IContentDocument[]
}
export interface ILink {
[key: string]: IContentDocument[]
}

18
types/content/page.ts Normal file
View File

@ -0,0 +1,18 @@
import { IContentDocument } from '@nuxt/content/types/content'
export interface IToc {
id: string;
depth: number;
text: string;
}
export interface IContent extends IContentDocument {
body: Object;
category: string;
description: string;
position: number;
title: string;
toc: IToc[];
image: string;
tags: string[];
}

4
types/vue-shims.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}