-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathoverloads.ts
More file actions
104 lines (93 loc) · 2.68 KB
/
overloads.ts
File metadata and controls
104 lines (93 loc) · 2.68 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import {
ApolloClientOptions,
DocumentNode,
InMemoryCacheConfig,
NormalizedCacheObject,
} from '@apollo/client';
import { _Hooks } from '@wordpress/hooks/build-types/createHooks.js';
import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
import { FaustToolbarNodes } from '../components/Toolbar/index.js';
import { SeedNode } from '../queries/seedQuery.js';
type FaustCoreFilters = {
addFilter(
hookName: 'apolloClientInMemoryCacheOptions',
namespace: string,
callback: (
inMemoryCacheObject: InMemoryCacheConfig,
context: Record<string, never>,
) => InMemoryCacheConfig,
priority?: number | undefined,
): void;
addFilter(
hookName: 'apolloClientOptions',
namespace: string,
callback: (
apolloClientOptions: ApolloClientOptions<NormalizedCacheObject>,
context: Record<string, never>,
) => ApolloClientOptions<NormalizedCacheObject>,
priority?: number | undefined,
): void;
addFilter(
hookName: 'possibleTemplatesList',
namespace: string,
callback: (
possibleTemplates: string[],
context: { seedNode: SeedNode },
) => string[],
priority?: number | undefined,
): void;
addFilter(
hookName: 'seedQueryDocumentNode',
namespace: string,
callback: (
seedQuery: DocumentNode,
context: { resolvedUrl: string },
) => DocumentNode,
priority?: number | undefined,
): void;
addFilter(
hookName: 'graphqlEndpoint',
namespace: string,
callback: (graphqlEndpoint: string, context: { wpUrl: string }) => string,
priority?: number | undefined,
): void;
addFilter(
hookName: 'wpHostname',
namespace: string,
callback: (wpHostname: string, context: { wpUrl: string }) => string,
priority?: number | undefined,
): void;
addFilter(
hookName: 'wpUrl',
namespace: string,
callback: (wpUrl: string, context: Record<string, never>) => string,
priority?: number | undefined,
): void;
addFilter(
hookName: 'wpAdminUrl',
namespace: string,
callback: (wpAdminUrl: string, context: Record<string, never>) => string,
priority?: number | undefined,
): void;
addFilter(
hookName: 'toolbarNodes',
namespace: string,
callback: (
toolbarNodes: FaustToolbarNodes,
context: { seedNode?: SeedNode },
) => string,
priority?: number | undefined,
): void;
addFilter(
hookName: 'resolvedUrl',
namespace: string,
callback: (
resolvedUrl: string | null,
context: {
nextContext: GetServerSidePropsContext | GetStaticPropsContext;
},
) => string | null,
priority?: number | undefined,
): void;
};
export type FaustHooks = _Hooks & FaustCoreFilters;