refact: extract duplicated File/Folder types

This commit is contained in:
Jean-Philippe Sirois
2019-09-17 01:58:44 -04:00
parent 5bd0787112
commit fee748c67d
6 changed files with 39 additions and 71 deletions
+32
View File
@@ -0,0 +1,32 @@
export interface IFile {
title: string
type: "file"
path: string
}
export interface IFolder {
title: string
type: "folder"
path: string
children: IFileOrFolder[]
}
export type IFileOrFolder = IFile | IFolder
export interface IFileQuery {
node: {
relativePath: string
childMarkdownRemark: {
frontmatter: {
author: string
date: string
}
}
}
}
export interface IAllResourcesQuery {
allFile: {
edges: IFileQuery[]
}
}