1 | import * as React from "react"
|
2 | import { EventEmitter } from "events"
|
3 | import { WindowLocation, NavigateFn } from "@reach/router"
|
4 | import { createContentDigest } from "gatsby-core-utils"
|
5 | import {
|
6 | ComposeEnumTypeConfig,
|
7 | ComposeInputObjectTypeConfig,
|
8 | ComposeInterfaceTypeConfig,
|
9 | ComposeObjectTypeConfig,
|
10 | ComposeScalarTypeConfig,
|
11 | ComposeUnionTypeConfig,
|
12 | } from "graphql-compose"
|
13 | import { GraphQLOutputType } from "graphql"
|
14 |
|
15 | export {
|
16 | default as Link,
|
17 | GatsbyLinkProps,
|
18 | navigate,
|
19 | navigateTo,
|
20 | push,
|
21 | replace,
|
22 | withPrefix,
|
23 | withAssetPrefix,
|
24 | } from "gatsby-link"
|
25 |
|
26 | export const useStaticQuery: <TData = any>(query: any) => TData
|
27 |
|
28 | export const parsePath: (path: string) => WindowLocation
|
29 |
|
30 | export const prefetchPathname: (path: string) => void
|
31 |
|
32 | export interface PageRendererProps {
|
33 | location: WindowLocation
|
34 | }
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | export class PageRenderer extends React.Component<PageRendererProps> {}
|
45 |
|
46 | type RenderCallback<T = any> = (data: T) => React.ReactNode
|
47 |
|
48 | export interface StaticQueryProps<T = any> {
|
49 | query: any
|
50 | render?: RenderCallback<T>
|
51 | children?: RenderCallback<T>
|
52 | }
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export class StaticQuery<T = any> extends React.Component<
|
65 | StaticQueryProps<T>
|
66 | > {}
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | export const graphql: (query: TemplateStringsArray) => void
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | export interface GatsbyConfig {
|
83 |
|
84 | siteMetadata?: Record<string, unknown>
|
85 |
|
86 | plugins?: Array<
|
87 | | string
|
88 | | {
|
89 | resolve: string
|
90 | options: Record<string, unknown>
|
91 | }
|
92 | >
|
93 |
|
94 | pathPrefix?: string
|
95 |
|
96 | polyfill?: boolean
|
97 | mapping?: Record<string, string>
|
98 | |
99 |
|
100 |
|
101 |
|
102 | proxy?: {
|
103 | prefix: string
|
104 | url: string
|
105 | }
|
106 |
|
107 | developMiddleware?(app: any): void
|
108 | }
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | export interface GatsbyNode {
|
116 | |
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 | createPages?(
|
124 | args: CreatePagesArgs & {
|
125 | traceId: "initial-createPages"
|
126 | },
|
127 | options?: PluginOptions,
|
128 | callback?: PluginCallback
|
129 | ): void
|
130 |
|
131 | |
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | createPagesStatefully?(
|
146 | args: CreatePagesArgs & {
|
147 | traceId: "initial-createPagesStatefully"
|
148 | },
|
149 | options?: PluginOptions,
|
150 | callback?: PluginCallback
|
151 | ): void
|
152 |
|
153 | |
154 |
|
155 |
|
156 |
|
157 |
|
158 | onCreateBabelConfig?(
|
159 | args: CreateBabelConfigArgs,
|
160 | options?: PluginOptions,
|
161 | callback?: PluginCallback
|
162 | ): void
|
163 |
|
164 | |
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 | onCreateDevServer?(
|
179 | args: CreateDevServerArgs,
|
180 | options?: PluginOptions,
|
181 | callback?: PluginCallback
|
182 | ): void
|
183 |
|
184 | |
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | onCreateNode?<TNode extends object = {}>(
|
198 | args: CreateNodeArgs<TNode>,
|
199 | options?: PluginOptions,
|
200 | callback?: PluginCallback
|
201 | ): void
|
202 |
|
203 | |
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | onCreatePage?<TNode extends object = {}>(
|
212 | args: CreatePageArgs<TNode>,
|
213 | options?: PluginOptions,
|
214 | callback?: PluginCallback
|
215 | ): void
|
216 |
|
217 | |
218 |
|
219 |
|
220 |
|
221 | onCreateWebpackConfig?(
|
222 | args: CreateWebpackConfigArgs,
|
223 | options?: PluginOptions,
|
224 | callback?: PluginCallback
|
225 | ): void
|
226 |
|
227 |
|
228 | onPostBootstrap?(
|
229 | args: ParentSpanPluginArgs,
|
230 | options?: PluginOptions,
|
231 | callback?: PluginCallback
|
232 | ): void
|
233 |
|
234 |
|
235 | onPostBuild?(
|
236 | args: BuildArgs,
|
237 | options?: PluginOptions,
|
238 | callback?: PluginCallback
|
239 | ): void
|
240 |
|
241 |
|
242 | onPreBootstrap?(
|
243 | args: ParentSpanPluginArgs,
|
244 | options?: PluginOptions,
|
245 | callback?: PluginCallback
|
246 | ): void
|
247 |
|
248 |
|
249 | onPreBuild?(
|
250 | args: BuildArgs,
|
251 | options?: PluginOptions,
|
252 | callback?: PluginCallback
|
253 | ): void
|
254 |
|
255 |
|
256 | onPreExtractQueries?(
|
257 | args: ParentSpanPluginArgs,
|
258 | options?: PluginOptions,
|
259 | callback?: PluginCallback
|
260 | ): void
|
261 |
|
262 |
|
263 | onPreInit?(
|
264 | args: ParentSpanPluginArgs,
|
265 | options?: PluginOptions,
|
266 | callback?: PluginCallback
|
267 | ): void
|
268 |
|
269 | |
270 |
|
271 |
|
272 |
|
273 | preprocessSource?(
|
274 | args: PreprocessSourceArgs,
|
275 | options?: PluginOptions,
|
276 | callback?: PluginCallback
|
277 | ): void
|
278 |
|
279 | |
280 |
|
281 |
|
282 | resolvableExtensions?(
|
283 | args: ResolvableExtensionsArgs,
|
284 | options: PluginOptions,
|
285 | callback: PluginCallback
|
286 | ): any[] | Promise<any[]>
|
287 |
|
288 | |
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 | setFieldsOnGraphQLNodeType?(
|
308 | args: SetFieldsOnGraphQLNodeTypeArgs,
|
309 | options: PluginOptions
|
310 | ): any
|
311 | setFieldsOnGraphQLNodeType?(
|
312 | args: SetFieldsOnGraphQLNodeTypeArgs,
|
313 | options: PluginOptions
|
314 | ): Promise<any>
|
315 | setFieldsOnGraphQLNodeType?(
|
316 | args: SetFieldsOnGraphQLNodeTypeArgs,
|
317 | options: PluginOptions,
|
318 | callback: PluginCallback
|
319 | ): void
|
320 |
|
321 | |
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 | sourceNodes?(args: SourceNodesArgs, options: PluginOptions): any
|
332 | sourceNodes?(args: SourceNodesArgs, options: PluginOptions): Promise<any>
|
333 | sourceNodes?(
|
334 | args: SourceNodesArgs,
|
335 | options: PluginOptions,
|
336 | callback: PluginCallback
|
337 | ): void
|
338 |
|
339 | |
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | createResolvers?(args: CreateResolversArgs, options: PluginOptions): any
|
377 | createResolvers?(
|
378 | args: CreateResolversArgs,
|
379 | options: PluginOptions
|
380 | ): Promise<any>
|
381 | createResolvers?(
|
382 | args: CreateResolversArgs,
|
383 | options: PluginOptions,
|
384 | callback: PluginCallback
|
385 | ): void
|
386 |
|
387 | |
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 | createSchemaCustomization?(
|
398 | args: CreateSchemaCustomizationArgs,
|
399 | options: PluginOptions
|
400 | ): any
|
401 | createSchemaCustomization?(
|
402 | args: CreateSchemaCustomizationArgs,
|
403 | options: PluginOptions
|
404 | ): Promise<any>
|
405 | createSchemaCustomization?(
|
406 | args: CreateSchemaCustomizationArgs,
|
407 | options: PluginOptions,
|
408 | callback: PluginCallback
|
409 | ): void
|
410 | }
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 | export interface GatsbyBrowser {
|
418 | disableCorePrefetching?(args: BrowserPluginArgs, options: PluginOptions): any
|
419 | onClientEntry?(args: BrowserPluginArgs, options: PluginOptions): any
|
420 | onInitialClientRender?(args: BrowserPluginArgs, options: PluginOptions): any
|
421 | onPostPrefetchPathname?(
|
422 | args: PrefetchPathnameArgs,
|
423 | options: PluginOptions
|
424 | ): any
|
425 | onPreRouteUpdate?(args: RouteUpdateArgs, options: PluginOptions): any
|
426 | onPrefetchPathname?(args: PrefetchPathnameArgs, options: PluginOptions): any
|
427 | onRouteUpdate?(args: RouteUpdateArgs, options: PluginOptions): any
|
428 | onRouteUpdateDelayed?(
|
429 | args: RouteUpdateDelayedArgs,
|
430 | options: PluginOptions
|
431 | ): any
|
432 | onServiceWorkerActive?(args: ServiceWorkerArgs, options: PluginOptions): any
|
433 | onServiceWorkerInstalled?(
|
434 | args: ServiceWorkerArgs,
|
435 | options: PluginOptions
|
436 | ): any
|
437 | onServiceWorkerRedundant?(
|
438 | args: ServiceWorkerArgs,
|
439 | options: PluginOptions
|
440 | ): any
|
441 | onServiceWorkerUpdateFound?(
|
442 | args: ServiceWorkerArgs,
|
443 | options: PluginOptions
|
444 | ): any
|
445 | registerServiceWorker?(args: BrowserPluginArgs, options: PluginOptions): any
|
446 | replaceComponentRenderer?(
|
447 | args: ReplaceComponentRendererArgs,
|
448 | options: PluginOptions
|
449 | ): any
|
450 | replaceHydrateFunction?(args: BrowserPluginArgs, options: PluginOptions): any
|
451 | shouldUpdateScroll?(args: ShouldUpdateScrollArgs, options: PluginOptions): any
|
452 | wrapPageElement?(
|
453 | args: WrapPageElementBrowserArgs,
|
454 | options: PluginOptions
|
455 | ): any
|
456 | wrapRootElement?(
|
457 | args: WrapRootElementBrowserArgs,
|
458 | options: PluginOptions
|
459 | ): any
|
460 | }
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | export interface GatsbySSR {
|
468 | |
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 | onPreRenderHTML?(args: PreRenderHTMLArgs, options: PluginOptions): any
|
488 | onPreRenderHTML?(
|
489 | args: PreRenderHTMLArgs,
|
490 | options: PluginOptions
|
491 | ): Promise<any>
|
492 | onPreRenderHTML?(
|
493 | args: PreRenderHTMLArgs,
|
494 | options: PluginOptions,
|
495 | callback: PluginCallback
|
496 | ): void
|
497 |
|
498 | |
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 | onRenderBody?(args: RenderBodyArgs, options: PluginOptions): any
|
536 | onRenderBody?(args: RenderBodyArgs, options: PluginOptions): Promise<any>
|
537 | onRenderBody?(
|
538 | args: RenderBodyArgs,
|
539 | options: PluginOptions,
|
540 | callback: PluginCallback
|
541 | ): void
|
542 |
|
543 | |
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 | replaceRenderer?(args: ReplaceRendererArgs, options: PluginOptions): any
|
560 | replaceRenderer?(
|
561 | args: ReplaceRendererArgs,
|
562 | options: PluginOptions
|
563 | ): Promise<any>
|
564 | replaceRenderer?(
|
565 | args: ReplaceRendererArgs,
|
566 | options: PluginOptions,
|
567 | callback: PluginCallback
|
568 | ): void
|
569 |
|
570 | |
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 | wrapPageElement?(args: WrapPageElementNodeArgs, options: PluginOptions): any
|
588 | wrapPageElement?(
|
589 | args: WrapPageElementNodeArgs,
|
590 | options: PluginOptions
|
591 | ): Promise<any>
|
592 | wrapPageElement?(
|
593 | args: WrapPageElementNodeArgs,
|
594 | options: PluginOptions,
|
595 | callback: PluginCallback
|
596 | ): void
|
597 | |
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 | wrapRootElement?(args: WrapRootElementNodeArgs, options: PluginOptions): any
|
620 | wrapRootElement?(
|
621 | args: WrapRootElementNodeArgs,
|
622 | options: PluginOptions
|
623 | ): Promise<any>
|
624 | wrapRootElement?(
|
625 | args: WrapRootElementNodeArgs,
|
626 | options: PluginOptions,
|
627 | callback: PluginCallback
|
628 | ): void
|
629 | }
|
630 |
|
631 | export interface PluginOptions {
|
632 | plugins: unknown[]
|
633 | [key: string]: unknown
|
634 | }
|
635 |
|
636 | export type PluginCallback = (err: Error | null, result?: any) => void
|
637 |
|
638 | export interface CreatePagesArgs extends ParentSpanPluginArgs {
|
639 | graphql<TData, TVariables = any>(
|
640 | query: string,
|
641 | variables?: TVariables
|
642 | ): Promise<{
|
643 | errors?: any
|
644 | data?: TData
|
645 | }>
|
646 | traceId: string
|
647 | waitForCascadingActions: boolean
|
648 | }
|
649 |
|
650 | type GatsbyStages =
|
651 | | "develop"
|
652 | | "develop-html"
|
653 | | "build-javascript"
|
654 | | "build-html"
|
655 |
|
656 | export interface CreateBabelConfigArgs extends ParentSpanPluginArgs {
|
657 | stage: GatsbyStages
|
658 | }
|
659 |
|
660 | export interface CreateDevServerArgs extends ParentSpanPluginArgs {
|
661 | app: any
|
662 | }
|
663 |
|
664 | export interface CreateNodeArgs<TNode extends object = {}>
|
665 | extends ParentSpanPluginArgs {
|
666 | node: Node & TNode
|
667 | traceId: string
|
668 | traceTags: {
|
669 | nodeId: string
|
670 | nodeType: string
|
671 | }
|
672 | }
|
673 |
|
674 | export interface CreatePageArgs<TNode extends object = {}>
|
675 | extends ParentSpanPluginArgs {
|
676 | page: Node & TNode
|
677 | traceId: string
|
678 | }
|
679 |
|
680 | export interface CreateWebpackConfigArgs extends ParentSpanPluginArgs {
|
681 | getConfig: Function
|
682 | stage: GatsbyStages
|
683 | rules: WebpackRules
|
684 | loaders: WebpackLoaders
|
685 | plugins: WebpackPlugins
|
686 | }
|
687 |
|
688 | export interface PreprocessSourceArgs extends ParentSpanPluginArgs {
|
689 | filename: string
|
690 | contents: string
|
691 | }
|
692 |
|
693 | export interface ResolvableExtensionsArgs extends ParentSpanPluginArgs {
|
694 | traceId: "initial-resolvableExtensions"
|
695 | }
|
696 |
|
697 | export interface SetFieldsOnGraphQLNodeTypeArgs extends ParentSpanPluginArgs {
|
698 | type: {
|
699 | name: string
|
700 | nodes: any[]
|
701 | }
|
702 | traceId: "initial-setFieldsOnGraphQLNodeType"
|
703 | }
|
704 |
|
705 | export interface GatsbyGraphQLObjectType {
|
706 | kind: "OBJECT"
|
707 | config: ComposeObjectTypeConfig<any, any>
|
708 | }
|
709 |
|
710 | interface GatsbyGraphQLInputObjectType {
|
711 | kind: "INPUT_OBJECT"
|
712 | config: ComposeInputObjectTypeConfig
|
713 | }
|
714 |
|
715 | interface GatsbyGraphQLUnionType {
|
716 | kind: "UNION"
|
717 | config: ComposeUnionTypeConfig<any, any>
|
718 | }
|
719 |
|
720 | interface GatsbyGraphQLInterfaceType {
|
721 | kind: "INTERFACE"
|
722 | config: ComposeInterfaceTypeConfig<any, any>
|
723 | }
|
724 |
|
725 | interface GatsbyGraphQLEnumType {
|
726 | kind: "ENUM"
|
727 | config: ComposeEnumTypeConfig
|
728 | }
|
729 |
|
730 | interface GatsbyGraphQLScalarType {
|
731 | kind: "SCALAR"
|
732 | config: ComposeScalarTypeConfig
|
733 | }
|
734 |
|
735 | export type GatsbyGraphQLType =
|
736 | | GatsbyGraphQLObjectType
|
737 | | GatsbyGraphQLInputObjectType
|
738 | | GatsbyGraphQLUnionType
|
739 | | GatsbyGraphQLInterfaceType
|
740 | | GatsbyGraphQLEnumType
|
741 | | GatsbyGraphQLScalarType
|
742 |
|
743 | export interface NodePluginSchema {
|
744 | buildObjectType(
|
745 | config: ComposeObjectTypeConfig<any, any>
|
746 | ): GatsbyGraphQLObjectType
|
747 | buildUnionType(
|
748 | config: ComposeUnionTypeConfig<any, any>
|
749 | ): GatsbyGraphQLUnionType
|
750 | buildInterfaceType(
|
751 | config: ComposeInterfaceTypeConfig<any, any>
|
752 | ): GatsbyGraphQLInterfaceType
|
753 | buildInputObjectType(
|
754 | config: ComposeInputObjectTypeConfig
|
755 | ): GatsbyGraphQLInputObjectType
|
756 | buildEnumType(config: ComposeEnumTypeConfig): GatsbyGraphQLEnumType
|
757 | buildScalarType(config: ComposeScalarTypeConfig): GatsbyGraphQLScalarType
|
758 | }
|
759 |
|
760 | export interface SourceNodesArgs extends ParentSpanPluginArgs {
|
761 | traceId: "initial-sourceNodes"
|
762 | waitForCascadingActions: boolean
|
763 | }
|
764 |
|
765 | export interface CreateResolversArgs extends ParentSpanPluginArgs {
|
766 | intermediateSchema: object
|
767 | createResolvers: Function
|
768 | traceId: "initial-createResolvers"
|
769 | }
|
770 |
|
771 | export interface CreateSchemaCustomizationArgs extends ParentSpanPluginArgs {
|
772 | traceId: "initial-createSchemaCustomization"
|
773 | }
|
774 |
|
775 | export interface PreRenderHTMLArgs extends NodePluginArgs {
|
776 | getHeadComponents: () => React.ReactNode[]
|
777 | replaceHeadComponents: (comp: React.ReactNode[]) => void
|
778 | getPreBodyComponents: () => React.ReactNode[]
|
779 | replacePreBodyComponents: (comp: React.ReactNode[]) => void
|
780 | getPostBodyComponents: () => React.ReactNode[]
|
781 | replacePostBodyComponents: (comp: React.ReactNode[]) => void
|
782 | }
|
783 |
|
784 | type ReactProps<T extends Element> = React.DetailedHTMLProps<
|
785 | React.HTMLAttributes<T>,
|
786 | T
|
787 | >
|
788 | export interface RenderBodyArgs extends NodePluginArgs {
|
789 | pathname: string
|
790 | setHeadComponents: (comp: React.ReactNode[]) => void
|
791 | setHtmlAttributes: (attr: ReactProps<HTMLHtmlElement>) => void
|
792 | setBodyAttributes: (attr: ReactProps<HTMLBodyElement>) => void
|
793 | setPreBodyComponents: (comp: React.ReactNode[]) => void
|
794 | setPostBodyComponents: (comp: React.ReactNode[]) => void
|
795 | setBodyProps: Function
|
796 | }
|
797 |
|
798 | export interface ReplaceRendererArgs extends NodePluginArgs {
|
799 | replaceBodyHTMLString: (str: string) => void
|
800 | setHeadComponents: (comp: React.ReactNode[]) => void
|
801 | setHtmlAttributes: (attr: ReactProps<HTMLHtmlElement>) => void
|
802 | setBodyAttributes: (attr: ReactProps<HTMLBodyElement>) => void
|
803 | setPreBodyComponents: (comp: React.ReactNode[]) => void
|
804 | setPostBodyComponents: (comp: React.ReactNode[]) => void
|
805 | setBodyProps: Function
|
806 | }
|
807 |
|
808 | export interface WrapPageElementNodeArgs extends NodePluginArgs {
|
809 | element: object
|
810 | props: object
|
811 | pathname: string
|
812 | }
|
813 |
|
814 | export interface WrapRootElementNodeArgs extends NodePluginArgs {
|
815 | element: object
|
816 | }
|
817 |
|
818 | export interface ParentSpanPluginArgs extends NodePluginArgs {
|
819 | parentSpan: object
|
820 | }
|
821 |
|
822 | export interface NodePluginArgs {
|
823 | pathPrefix: string
|
824 | boundActionCreators: Actions
|
825 | actions: Actions
|
826 | loadNodeContent: Function
|
827 | store: Store
|
828 | emitter: EventEmitter
|
829 | getNodes: Function
|
830 | getNode: Function
|
831 | getNodesByType: Function
|
832 | hasNodeChanged: Function
|
833 | reporter: Reporter
|
834 | getNodeAndSavePathDependency: Function
|
835 | cache: Cache["cache"]
|
836 | createNodeId: Function
|
837 | createContentDigest: typeof createContentDigest
|
838 | tracing: Tracing
|
839 | schema: NodePluginSchema
|
840 | [key: string]: unknown
|
841 | }
|
842 |
|
843 | interface ActionPlugin {
|
844 | name: string
|
845 | }
|
846 |
|
847 | interface DeleteNodeArgs {
|
848 | node: Node
|
849 | }
|
850 |
|
851 | interface CreateNodeFieldArgs {
|
852 | node: Node
|
853 | name: string
|
854 | value: string
|
855 |
|
856 | |
857 |
|
858 |
|
859 | fieldName?: string
|
860 |
|
861 | |
862 |
|
863 |
|
864 | fieldValue?: string
|
865 | }
|
866 |
|
867 | interface ActionOptions {
|
868 | [key: string]: unknown
|
869 | }
|
870 |
|
871 | export interface BuildArgs extends ParentSpanPluginArgs {
|
872 | graphql: Function
|
873 | }
|
874 |
|
875 | export interface Actions {
|
876 |
|
877 | deletePage(args: { path: string; component: string }): void
|
878 |
|
879 |
|
880 | createPage<TContext = Record<string, unknown>>(
|
881 | args: {
|
882 | path: string
|
883 | matchPath?: string
|
884 | component: string
|
885 | context: TContext
|
886 | },
|
887 | plugin?: ActionPlugin,
|
888 | option?: ActionOptions
|
889 | ): void
|
890 |
|
891 |
|
892 | deleteNode(
|
893 | options: { node: Node },
|
894 | plugin?: ActionPlugin,
|
895 | option?: ActionOptions
|
896 | ): void
|
897 |
|
898 | |
899 |
|
900 |
|
901 |
|
902 | deleteNodes(nodes: string[], plugin?: ActionPlugin): void
|
903 |
|
904 |
|
905 | createNode(
|
906 | node: NodeInput,
|
907 | plugin?: ActionPlugin,
|
908 | options?: ActionOptions
|
909 | ): void
|
910 |
|
911 |
|
912 | touchNode(node: { nodeId: string }, plugin?: ActionPlugin): void
|
913 |
|
914 |
|
915 | createNodeField(
|
916 | args: {
|
917 | node: Node
|
918 | fieldName?: string
|
919 | fieldValue?: string
|
920 | name?: string
|
921 | value: any
|
922 | },
|
923 | plugin?: ActionPlugin,
|
924 | options?: ActionOptions
|
925 | ): void
|
926 |
|
927 |
|
928 | createParentChildLink(
|
929 | args: { parent: Node; child: Node },
|
930 | plugin?: ActionPlugin
|
931 | ): void
|
932 |
|
933 |
|
934 | setWebpackConfig(config: object, plugin?: ActionPlugin): void
|
935 |
|
936 |
|
937 | replaceWebpackConfig(config: object, plugin?: ActionPlugin): void
|
938 |
|
939 |
|
940 | setBabelOptions(options: object, plugin?: ActionPlugin): void
|
941 |
|
942 |
|
943 | setBabelPlugin(
|
944 | config: { name: string; options: object },
|
945 | plugin?: ActionPlugin
|
946 | ): void
|
947 |
|
948 |
|
949 | setBabelPreset(
|
950 | config: { name: string; options: object },
|
951 | plugin?: ActionPlugin
|
952 | ): void
|
953 |
|
954 |
|
955 | createJob(
|
956 | job: Record<string, unknown> & { id: string },
|
957 | plugin?: ActionPlugin
|
958 | ): void
|
959 |
|
960 |
|
961 | createJobV2(
|
962 | job: {
|
963 | name: string
|
964 | inputPaths: string[]
|
965 | outputDir: string
|
966 | args: Record<string, unknown>
|
967 | },
|
968 | plugin?: ActionPlugin
|
969 | ): Promise<unknown>
|
970 |
|
971 |
|
972 | setJob(
|
973 | job: Record<string, unknown> & { id: string },
|
974 | plugin?: ActionPlugin
|
975 | ): void
|
976 |
|
977 |
|
978 | endJob(job: { id: string }, plugin?: ActionPlugin): void
|
979 |
|
980 |
|
981 | setPluginStatus(status: Record<string, unknown>, plugin?: ActionPlugin): void
|
982 |
|
983 |
|
984 | createRedirect(
|
985 | redirect: {
|
986 | fromPath: string
|
987 | isPermanent?: boolean
|
988 | toPath: string
|
989 | redirectInBrowser?: boolean
|
990 | force?: boolean
|
991 | statusCode?: number
|
992 | [key: string]: unknown
|
993 | },
|
994 | plugin?: ActionPlugin
|
995 | ): void
|
996 |
|
997 |
|
998 | addThirdPartySchema(
|
999 | args: { schema: object },
|
1000 | plugin?: ActionPlugin,
|
1001 | traceId?: string
|
1002 | ): void
|
1003 |
|
1004 |
|
1005 | createTypes(
|
1006 | types:
|
1007 | | string
|
1008 | | GraphQLOutputType
|
1009 | | GatsbyGraphQLType
|
1010 | | string[]
|
1011 | | GraphQLOutputType[]
|
1012 | | GatsbyGraphQLType[],
|
1013 | plugin?: ActionPlugin,
|
1014 | traceId?: string
|
1015 | ): void
|
1016 |
|
1017 |
|
1018 | createFieldExtension(
|
1019 | extension: object,
|
1020 | plugin: ActionPlugin,
|
1021 | traceId?: string
|
1022 | ): void
|
1023 | }
|
1024 |
|
1025 | export interface Store {
|
1026 | dispatch: Function
|
1027 | subscribe: Function
|
1028 | getState: Function
|
1029 | replaceReducer: Function
|
1030 | }
|
1031 |
|
1032 | type LogMessageType = (format: string) => void
|
1033 | type LogErrorType = (errorMeta: string | Object, error?: Object) => void
|
1034 |
|
1035 | export type ActivityTracker = {
|
1036 | start(): () => void
|
1037 | end(): () => void
|
1038 | span: Object
|
1039 | setStatus(status: string): void
|
1040 | panic: LogErrorType
|
1041 | panicOnBuild: LogErrorType
|
1042 | }
|
1043 |
|
1044 | export type ProgressActivityTracker = Omit<ActivityTracker, "end"> & {
|
1045 | tick(increment?: number): void
|
1046 | done(): void
|
1047 | total: number
|
1048 | }
|
1049 |
|
1050 | export type ActivityArgs = {
|
1051 | parentSpan?: Object
|
1052 | id?: string
|
1053 | }
|
1054 |
|
1055 | export interface Reporter {
|
1056 | stripIndent: (input: string) => string
|
1057 | format: object
|
1058 | setVerbose(isVerbose?: boolean): void
|
1059 | setNoColor(isNoColor?: boolean): void
|
1060 | panic: LogErrorType
|
1061 | panicOnBuild: LogErrorType
|
1062 | error: LogErrorType
|
1063 | uptime(prefix: string): void
|
1064 | success: LogMessageType
|
1065 | verbose: LogMessageType
|
1066 | info: LogMessageType
|
1067 | warn: LogMessageType
|
1068 | log: LogMessageType
|
1069 | activityTimer(name: string, activityArgs?: ActivityArgs): ActivityTracker
|
1070 | createProgress(
|
1071 | text: string,
|
1072 | total?: number,
|
1073 | start?: number,
|
1074 | activityArgs?: ActivityArgs
|
1075 | ): ProgressActivityTracker
|
1076 | }
|
1077 |
|
1078 | export interface Cache {
|
1079 | name: string
|
1080 | store: {
|
1081 | create: Function
|
1082 | }
|
1083 | cache: {
|
1084 | getAndPassUp: Function
|
1085 | wrap: Function
|
1086 | set: Function
|
1087 | mset: Function
|
1088 | get: Function
|
1089 | mget: Function
|
1090 | del: Function
|
1091 | reset: Function
|
1092 | }
|
1093 | }
|
1094 |
|
1095 | export interface Tracing {
|
1096 | tracer: object
|
1097 | parentSpan: object
|
1098 | startSpan: Function
|
1099 | }
|
1100 |
|
1101 | export interface PackageJson {
|
1102 | name?: string
|
1103 | description?: string
|
1104 | version?: string
|
1105 | main?: string
|
1106 | author?:
|
1107 | | string
|
1108 | | {
|
1109 | name: string
|
1110 | email: string
|
1111 | }
|
1112 | license?: string
|
1113 | dependencies?: Array<Record<string, string>>
|
1114 | devDependencies?: Array<Record<string, string>>
|
1115 | peerDependencies?: Array<Record<string, string>>
|
1116 | optionalDependecies?: Array<Record<string, string>>
|
1117 | bundledDependecies?: Array<Record<string, string>>
|
1118 | keywords?: string[]
|
1119 | }
|
1120 |
|
1121 | export interface WebpackRules {
|
1122 | js: Function
|
1123 | mjs: Function
|
1124 | eslint: Function
|
1125 | yaml: Function
|
1126 | fonts: Function
|
1127 | images: Function
|
1128 | media: Function
|
1129 | miscAssets: Function
|
1130 | css: Function
|
1131 | cssModules: Function
|
1132 | postcss: Function
|
1133 | [key: string]: Function
|
1134 | }
|
1135 |
|
1136 | export interface WebpackLoaders {
|
1137 | json: Function
|
1138 | yaml: Function
|
1139 | null: Function
|
1140 | raw: Function
|
1141 | style: Function
|
1142 | miniCssExtract: Function
|
1143 | css: Function
|
1144 | postcss: Function
|
1145 | file: Function
|
1146 | url: Function
|
1147 | js: Function
|
1148 | eslint: Function
|
1149 | imports: Function
|
1150 | exports: Function
|
1151 | [key: string]: Function
|
1152 | }
|
1153 |
|
1154 | export interface WebpackPlugins {
|
1155 | normalModuleReplacement: Function
|
1156 | contextReplacement: Function
|
1157 | ignore: Function
|
1158 | watchIgnore: Function
|
1159 | banner: Function
|
1160 | prefetch: Function
|
1161 | automaticPrefetch: Function
|
1162 | define: Function
|
1163 | provide: Function
|
1164 | hotModuleReplacement: Function
|
1165 | sourceMapDevTool: Function
|
1166 | evalSourceMapDevTool: Function
|
1167 | evalDevToolModule: Function
|
1168 | cache: Function
|
1169 | extendedAPI: Function
|
1170 | externals: Function
|
1171 | jsonpTemplate: Function
|
1172 | libraryTemplate: Function
|
1173 | loaderTarget: Function
|
1174 | memoryOutputFile: Function
|
1175 | progress: Function
|
1176 | setVarMainTemplate: Function
|
1177 | umdMainTemplate: Function
|
1178 | noErrors: Function
|
1179 | noEmitOnErrors: Function
|
1180 | newWatching: Function
|
1181 | environment: Function
|
1182 | dll: Function
|
1183 | dllReference: Function
|
1184 | loaderOptions: Function
|
1185 | namedModules: Function
|
1186 | namedChunks: Function
|
1187 | hashedModuleIds: Function
|
1188 | moduleFilenameH: Function
|
1189 | aggressiveMerging: Function
|
1190 | aggressiveSplitting: Function
|
1191 | splitChunks: Function
|
1192 | chunkModuleIdRange: Function
|
1193 | dedupe: Function
|
1194 | limitChunkCount: Function
|
1195 | minChunkSize: Function
|
1196 | occurrenceOrder: Function
|
1197 | moduleConcatenation: Function
|
1198 | minifyJs: Function
|
1199 | minifyCss: Function
|
1200 | extractText: Function
|
1201 | moment: Function
|
1202 | [key: string]: Function
|
1203 | }
|
1204 |
|
1205 | export interface PrefetchPathnameArgs extends BrowserPluginArgs {
|
1206 | pathname: string
|
1207 | }
|
1208 |
|
1209 | export interface RouteUpdateArgs extends BrowserPluginArgs {
|
1210 | location: Location
|
1211 | }
|
1212 |
|
1213 | export interface ReplaceComponentRendererArgs extends BrowserPluginArgs {
|
1214 | props: {
|
1215 | path: string
|
1216 | "*": string
|
1217 | uri: string
|
1218 | location: Location
|
1219 | navigate: NavigateFn
|
1220 | children: undefined
|
1221 | pageResources: object
|
1222 | data: object
|
1223 | pageContext: Record<string, unknown>
|
1224 | pathContext: Record<string, unknown>
|
1225 | }
|
1226 | loader: object
|
1227 | }
|
1228 |
|
1229 | export interface ShouldUpdateScrollArgs extends BrowserPluginArgs {
|
1230 | prevRouterProps?: {
|
1231 | location: Location
|
1232 | }
|
1233 | pathname: string
|
1234 | routerProps: {
|
1235 | location: Location
|
1236 | }
|
1237 | getSavedScrollPosition: Function
|
1238 | }
|
1239 |
|
1240 | export interface WrapPageElementBrowserArgs extends BrowserPluginArgs {
|
1241 | element: object
|
1242 | props: object
|
1243 | }
|
1244 |
|
1245 | export interface WrapRootElementBrowserArgs extends BrowserPluginArgs {
|
1246 | element: object
|
1247 | pathname: string
|
1248 | }
|
1249 |
|
1250 | export interface BrowserPluginArgs {
|
1251 | getResourcesForPathnameSync: Function
|
1252 | getResourcesForPathname: Function
|
1253 | getResourceURLsForPathname: Function
|
1254 | [key: string]: unknown
|
1255 | }
|
1256 |
|
1257 | export interface RouteUpdateDelayedArgs extends BrowserPluginArgs {
|
1258 | location: Location
|
1259 | }
|
1260 |
|
1261 | export interface ServiceWorkerArgs extends BrowserPluginArgs {
|
1262 | serviceWorker: ServiceWorkerRegistration
|
1263 | }
|
1264 |
|
1265 | export interface NodeInput {
|
1266 | id: string
|
1267 | parent?: string
|
1268 | children?: string[]
|
1269 | internal: {
|
1270 | type: string
|
1271 | mediaType?: string
|
1272 | content?: string
|
1273 | contentDigest: string
|
1274 | description?: string
|
1275 | }
|
1276 | [key: string]: unknown
|
1277 | }
|
1278 |
|
1279 | export interface Node extends NodeInput {
|
1280 | parent: string
|
1281 | children: string[]
|
1282 | internal: NodeInput["internal"] & {
|
1283 | owner: string
|
1284 | }
|
1285 | [key: string]: unknown
|
1286 | }
|