mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 04:32:32 +02:00
improvement: flow coverage
This commit is contained in:
53
src/types/index.js
Normal file
53
src/types/index.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// @flow
|
||||
import type { Node as ReactNode } from 'react';
|
||||
|
||||
export type RenderCallback = (data: any) => ReactNode;
|
||||
|
||||
export type Entry = (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,
|
||||
},
|
||||
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;
|
Reference in New Issue
Block a user