Open History to see the last commit
1import type { Type } from '@angular/core'
2import type {
3 ClientEventBusConfig,
4 TanStackDevtoolsConfig,
5 TanStackDevtoolsPluginProps,
6} from '@tanstack/devtools'
7β
8export type TanStackDevtoolsAngularPluginInputs =
9 | Record<string, any>
10 | (() => Record<string, any>)
11β
12interface DefaultExport<T> {
13 /**
14 * Default exports are bound under the name `"default"`, per the ES Module spec:
15 * https://tc39.es/ecma262/#table-export-forms-mapping-to-exportentry-records
16 */
17 default: T
18}
19β
20export interface TanStackDevtoolsAngularPluginInputProps extends TanStackDevtoolsPluginProps {
21 [key: string]: any
22}
23β
24export type TanStackDevtoolsAngularFunctionalComponent<
25 TInputs extends TanStackDevtoolsAngularPluginInputProps =
26 TanStackDevtoolsAngularPluginInputProps,
27> = (inputs: () => TInputs, hostElement: HTMLElement) => () => void
28β
29export type TanStackDevtoolsAngularPluginRenderFn =
30 | TanStackDevtoolsAngularFunctionalComponent<TanStackDevtoolsAngularPluginInputProps>
31 | DefaultExport<Type<unknown> | null>
32 | Type<unknown>
33 | null
34β
35export type TanStackDevtoolsAngularPluginRender =
36 | null
37 | Type<any>
38 | (() =>
39 | TanStackDevtoolsAngularPluginRenderFn
40 | Promise<TanStackDevtoolsAngularPluginRenderFn>)
41β
42export type TanStackDevtoolsAngularPlugin = {
43 id?: string
44 render: TanStackDevtoolsAngularPluginRender
45 name: string | Type<any>
46 inputs?: TanStackDevtoolsAngularPluginInputs
47 defaultOpen?: boolean
48}
49β
50export interface TanStackDevtoolsAngularInit {
51 /**
52 * Array of plugins to be used in the devtools.
53 * Each plugin should have a `component` that is an Angular component class.
54 *
55 * Example:
56 * ```typescript
57 * @Component({
58 * template: `<tanstack-devtools [plugins]="plugins" />`,
59 * imports: [TanStackDevtoolsComponent],
60 * })
61 * class AppComponent {
62 * plugins: TanStackDevtoolsAngularPlugin[] = [
63 * { name: 'My Plugin', component: MyPluginComponent }
64 * ];
65 * }
66 * ```
67 */
68 plugins?: Array<TanStackDevtoolsAngularPlugin>
69 /**
70 * Configuration for the devtools shell. These configuration options are used to set the
71 * initial state of the devtools when it is started for the first time. Afterwards,
72 * the settings are persisted in local storage and changed through the settings panel.
73 */
74 config?: Partial<TanStackDevtoolsConfig>
75 /**
76 * Configuration for the TanStack Devtools client event bus.
77 */
78 eventBusConfig?: ClientEventBusConfig
79}