mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 04:32:32 +02:00
refactor(starter): upgrade to new version of gatsby
This commit is contained in:
11
src/types/all-markdown-remark.ts
Normal file
11
src/types/all-markdown-remark.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import Edge from "./edge";
|
||||
|
||||
interface AllMarkdownRemark {
|
||||
edges: Array<Edge>;
|
||||
group: Array<{
|
||||
fieldValue: string;
|
||||
totalCount: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export default AllMarkdownRemark;
|
5
src/types/dictionary.ts
Normal file
5
src/types/dictionary.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
interface Dictionary<T> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
export default Dictionary;
|
7
src/types/edge.ts
Normal file
7
src/types/edge.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import Node from "./node";
|
||||
|
||||
interface Edge {
|
||||
node: Node;
|
||||
}
|
||||
|
||||
export default Edge;
|
7
src/types/fields.ts
Normal file
7
src/types/fields.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
interface Fields {
|
||||
slug: string;
|
||||
categorySlug: string;
|
||||
tagSlugs?: Array<string>;
|
||||
}
|
||||
|
||||
export default Fields;
|
13
src/types/frontmatter.ts
Normal file
13
src/types/frontmatter.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
interface Frontmatter {
|
||||
date: string;
|
||||
title: string;
|
||||
category: string;
|
||||
template: string;
|
||||
description?: string;
|
||||
tags?: Array<string>;
|
||||
socialImage?: {
|
||||
publicURL: string;
|
||||
};
|
||||
}
|
||||
|
||||
export default Frontmatter;
|
@@ -1,61 +0,0 @@
|
||||
// @flow strict
|
||||
import type { Node as ReactNode } from 'react';
|
||||
|
||||
export type RenderCallback = {
|
||||
// $FlowFixMe
|
||||
render: (data: any) => ReactNode;
|
||||
}
|
||||
|
||||
export type Entry = {
|
||||
getIn: (string[]) => string;
|
||||
}
|
||||
|
||||
export type WidgetFor = (string) => string;
|
||||
|
||||
export type PageContext = {
|
||||
tag: string,
|
||||
category: string,
|
||||
currentPage: number,
|
||||
prevPagePath: string,
|
||||
nextPagePath: string,
|
||||
hasPrevPage: boolean,
|
||||
hasNextPage: boolean
|
||||
};
|
||||
|
||||
export type Node = {
|
||||
fields: {
|
||||
slug: string,
|
||||
categorySlug?: string,
|
||||
tagSlugs?: string[]
|
||||
},
|
||||
frontmatter: {
|
||||
date: string,
|
||||
description?: string,
|
||||
category?: string,
|
||||
tags?: string[],
|
||||
title: string,
|
||||
socialImage?: {
|
||||
publicURL: string
|
||||
}
|
||||
},
|
||||
html: string,
|
||||
id: string
|
||||
};
|
||||
|
||||
export type Edge = {
|
||||
node: Node
|
||||
};
|
||||
|
||||
export type Edges = Array<Edge>;
|
||||
|
||||
export type AllMarkdownRemark = {
|
||||
allMarkdownRemark: {
|
||||
edges: Edges,
|
||||
},
|
||||
group: {
|
||||
fieldValue: string,
|
||||
totalCount: number
|
||||
}[]
|
||||
};
|
||||
|
||||
export type MarkdownRemark = Node;
|
7
src/types/index.ts
Normal file
7
src/types/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type { default as Edge } from "./edge";
|
||||
export type { default as Node } from "./node";
|
||||
export type { default as Dictionary } from "./dictionary";
|
||||
export type { default as Nullable } from "./nullable";
|
||||
export type { default as PageContext } from "./page-context";
|
||||
export type { default as Pagination } from "./pagination";
|
||||
export type { default as AllMarkdownRemark } from "./all-markdown-remark";
|
11
src/types/node.ts
Normal file
11
src/types/node.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import Fields from "./fields";
|
||||
import Frontmatter from "./frontmatter";
|
||||
|
||||
interface Node {
|
||||
id: string;
|
||||
fields: Fields;
|
||||
frontmatter: Frontmatter;
|
||||
html: string;
|
||||
}
|
||||
|
||||
export default Node;
|
3
src/types/nullable.ts
Normal file
3
src/types/nullable.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
type Nullable<T> = T | null;
|
||||
|
||||
export default Nullable;
|
8
src/types/page-context.ts
Normal file
8
src/types/page-context.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import Pagination from "./pagination";
|
||||
|
||||
interface PageContext {
|
||||
group?: string;
|
||||
pagination: Pagination;
|
||||
}
|
||||
|
||||
export default PageContext;
|
9
src/types/pagination.ts
Normal file
9
src/types/pagination.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
interface Pagination {
|
||||
currentPage: number;
|
||||
prevPagePath: string;
|
||||
nextPagePath: string;
|
||||
hasPrevPage: boolean;
|
||||
hasNextPage: boolean;
|
||||
}
|
||||
|
||||
export default Pagination;
|
Reference in New Issue
Block a user