2017-05-04 05:49:50 +00:00
|
|
|
// @flow
|
2020-08-09 16:48:04 +00:00
|
|
|
import { type Location } from "react-router-dom";
|
2020-11-09 08:01:50 +00:00
|
|
|
import theme from "shared/styles/theme";
|
2020-06-20 20:59:15 +00:00
|
|
|
import Document from "models/Document";
|
2018-09-30 04:24:07 +00:00
|
|
|
|
2020-11-09 08:01:50 +00:00
|
|
|
export type Theme = typeof theme;
|
|
|
|
|
2020-08-09 16:48:04 +00:00
|
|
|
export type LocationWithState = Location & {
|
|
|
|
state: {
|
|
|
|
[key: string]: string,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-01-30 05:36:09 +00:00
|
|
|
export type Toast = {|
|
2019-01-10 06:41:06 +00:00
|
|
|
id: string,
|
|
|
|
createdAt: string,
|
2018-05-31 19:07:49 +00:00
|
|
|
message: string,
|
2020-06-20 20:59:15 +00:00
|
|
|
type: "warning" | "error" | "info" | "success",
|
2019-04-18 02:11:23 +00:00
|
|
|
timeout?: number,
|
2021-01-03 05:09:43 +00:00
|
|
|
reoccurring?: number,
|
2019-04-18 02:11:23 +00:00
|
|
|
action?: {
|
|
|
|
text: string,
|
|
|
|
onClick: () => void,
|
|
|
|
},
|
2021-01-30 05:36:09 +00:00
|
|
|
|};
|
2018-05-31 19:07:49 +00:00
|
|
|
|
2018-12-05 06:24:30 +00:00
|
|
|
export type FetchOptions = {
|
|
|
|
prefetch?: boolean,
|
|
|
|
revisionId?: string,
|
|
|
|
shareId?: string,
|
|
|
|
force?: boolean,
|
2017-05-12 00:23:56 +00:00
|
|
|
};
|
|
|
|
|
2021-01-30 05:36:09 +00:00
|
|
|
export type NavigationNode = {|
|
2017-05-13 22:36:06 +00:00
|
|
|
id: string,
|
|
|
|
title: string,
|
|
|
|
url: string,
|
2018-07-01 02:19:37 +00:00
|
|
|
children: NavigationNode[],
|
2021-01-30 05:36:09 +00:00
|
|
|
|};
|
2017-05-13 22:36:06 +00:00
|
|
|
|
2017-12-04 00:50:50 +00:00
|
|
|
// Pagination response in an API call
|
2017-05-04 05:49:50 +00:00
|
|
|
export type Pagination = {
|
|
|
|
limit: number,
|
|
|
|
nextPath: string,
|
|
|
|
offset: number,
|
|
|
|
};
|
2017-05-12 00:23:56 +00:00
|
|
|
|
2017-12-04 00:50:50 +00:00
|
|
|
// Pagination request params
|
2021-01-30 05:36:09 +00:00
|
|
|
export type PaginationParams = {|
|
2017-12-04 00:50:50 +00:00
|
|
|
limit?: number,
|
|
|
|
offset?: number,
|
|
|
|
sort?: string,
|
2020-06-20 20:59:15 +00:00
|
|
|
direction?: "ASC" | "DESC",
|
2021-01-30 05:36:09 +00:00
|
|
|
|};
|
2017-12-04 00:50:50 +00:00
|
|
|
|
2018-08-05 01:32:56 +00:00
|
|
|
export type SearchResult = {
|
|
|
|
ranking: number,
|
|
|
|
context: string,
|
|
|
|
document: Document,
|
|
|
|
};
|