-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
39 lines (32 loc) · 1 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
import { KeystoneGraphQLAPI, KeystoneListsAPI } from '@keystone-next/keystone/types';
// NOTE -- these types are commented out in master because they aren't generated by the build (yet)
// To get full List and GraphQL API type support, uncomment them here and use them below
// import type { KeystoneListsTypeInfo } from './.keystone/schema-types';
import type { Permission } from './schemas/fields';
export type { Permission } from './schemas/fields';
export type Session = {
itemId: string;
listKey: string;
data: {
name: string;
role?: {
id: string;
name: string;
} & {
[key in Permission]: boolean;
};
};
};
export type ListsAPI = KeystoneListsAPI<any /* KeystoneListsTypeInfo */>;
export type GraphqlAPI = KeystoneGraphQLAPI<any /* KeystoneListsTypeInfo */>;
export type AccessArgs = {
session?: Session;
item?: any;
};
export type AccessControl = {
[key: string]: (args: AccessArgs) => any;
};
export type ListAccessArgs = {
itemId?: string;
session?: Session;
};