-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
60 lines (53 loc) · 1.52 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { ImportAPI } from 'import-module';
import { CollectionAPI } from './sources/collection';
import { StorageAPI } from './sources/storage';
import {
AdvancedFilter,
Maybe,
MetadataFieldOption,
PermissionRequestInfo,
Formatters,
} from '../../generated-types/type-defs';
import { TranscodeService } from './sources/transcode';
import { OcrService } from './sources/ocr';
import { AuthRESTDataSource } from "./auth/AuthRESTDataSource";
export interface OptionalDataSources {
CollectionAPI?: CollectionAPI;
ImportAPI?: ImportAPI;
StorageAPI?: StorageAPI;
TranscodeService?: TranscodeService;
OcrService?: OcrService;
[key: string]: AuthRESTDataSource;
}
export interface DataSources {
CollectionAPI: CollectionAPI;
ImportAPI: ImportAPI;
StorageAPI: StorageAPI;
TranscodeService: TranscodeService;
OcrService: OcrService;
[key: string]: AuthRESTDataSource;
}
export interface ContextValue {
dataSources: DataSources;
customPermissions: { [key: string]: PermissionRequestInfo };
customFormatters: FormattersConfig;
customTypeUrlMapping: TypeUrlMapping;
}
// TODO: Remove if unused
export type filter = {
key: string;
label: string;
type: string;
options?: Maybe<MetadataFieldOption>[];
isRelation?: boolean;
};
type Filters = {
filters: Record<string, Array<AdvancedFilter>>;
};
export type FormattersConfig = {
[formatterType: string]: {
[key: string]: Formatters;
};
};
export type TypeUrlMapping = { [type: string]: string };
export type Config = Record<string, Array<string>> & Filters;