@constructive-io/schema-builder 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/card-widths-CmIxkRfh.cjs +28 -0
  3. package/dist/card-widths-CmIxkRfh.cjs.map +1 -0
  4. package/dist/card-widths-pI4Kw4Xz.js +22 -0
  5. package/dist/card-widths-pI4Kw4Xz.js.map +1 -0
  6. package/dist/core-WwCS0CKu.cjs +66 -0
  7. package/dist/core-WwCS0CKu.cjs.map +1 -0
  8. package/dist/core-kx6KjxE5.js +49 -0
  9. package/dist/core-kx6KjxE5.js.map +1 -0
  10. package/dist/core.cjs +14 -212
  11. package/dist/core.d.cts +3 -54
  12. package/dist/core.d.ts +3 -54
  13. package/dist/core.js +3 -200
  14. package/dist/create-table-card-BzNKfpXO.cjs +7726 -0
  15. package/dist/create-table-card-BzNKfpXO.cjs.map +1 -0
  16. package/dist/create-table-card-pZ0Aq6rr.js +7685 -0
  17. package/dist/create-table-card-pZ0Aq6rr.js.map +1 -0
  18. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs +42 -0
  19. package/dist/delete-confirm-dialog-Ch4tWj6B.cjs.map +1 -0
  20. package/dist/delete-confirm-dialog-K0AWE643.js +37 -0
  21. package/dist/delete-confirm-dialog-K0AWE643.js.map +1 -0
  22. package/dist/empty-state-card-DMn8ADRq.cjs +62 -0
  23. package/dist/empty-state-card-DMn8ADRq.cjs.map +1 -0
  24. package/dist/empty-state-card-Dnn36JVH.js +57 -0
  25. package/dist/empty-state-card-Dnn36JVH.js.map +1 -0
  26. package/dist/fields.cjs +8 -7763
  27. package/dist/fields.d.cts +39 -39
  28. package/dist/fields.d.ts +39 -39
  29. package/dist/fields.js +2 -7735
  30. package/dist/generated-types-DZMUyNBH.d.cts +27 -0
  31. package/dist/generated-types-DZMUyNBH.d.ts +27 -0
  32. package/dist/index-9h0EROdb.d.cts +56 -0
  33. package/dist/index-CwQ9QpxA.d.ts +7 -0
  34. package/dist/index-DOWB1UBK.d.cts +56 -0
  35. package/dist/index-DOWB1UBK.d.ts +56 -0
  36. package/dist/index-Dgb_e3AP.d.cts +7 -0
  37. package/dist/index-p_NegPQ5.d.ts +56 -0
  38. package/dist/index.cjs +736 -13712
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +4 -10
  41. package/dist/index.d.ts +4 -10
  42. package/dist/index.js +725 -13680
  43. package/dist/index.js.map +1 -1
  44. package/dist/indexes-view-CJ1WQKdp.js +736 -0
  45. package/dist/indexes-view-CJ1WQKdp.js.map +1 -0
  46. package/dist/indexes-view-peIv6QUZ.cjs +759 -0
  47. package/dist/indexes-view-peIv6QUZ.cjs.map +1 -0
  48. package/dist/indexes.cjs +6 -1041
  49. package/dist/indexes.d.cts +27 -27
  50. package/dist/indexes.d.ts +27 -27
  51. package/dist/indexes.js +2 -1016
  52. package/dist/invalidate-database-entities-9DsT5NlP.cjs +2862 -0
  53. package/dist/invalidate-database-entities-9DsT5NlP.cjs.map +1 -0
  54. package/dist/invalidate-database-entities-CmmOT3S0.js +2559 -0
  55. package/dist/invalidate-database-entities-CmmOT3S0.js.map +1 -0
  56. package/dist/keyboard-activation-BQiV0scm.js +13 -0
  57. package/dist/keyboard-activation-BQiV0scm.js.map +1 -0
  58. package/dist/keyboard-activation-D-L0IU6Y.cjs +19 -0
  59. package/dist/keyboard-activation-D-L0IU6Y.cjs.map +1 -0
  60. package/dist/policies-view-BRbpbyB6.js +1018 -0
  61. package/dist/policies-view-BRbpbyB6.js.map +1 -0
  62. package/dist/policies-view-H1HTjpmv.cjs +1023 -0
  63. package/dist/policies-view-H1HTjpmv.cjs.map +1 -0
  64. package/dist/policies.cjs +10 -5939
  65. package/dist/policies.d.cts +55 -50
  66. package/dist/policies.d.ts +55 -50
  67. package/dist/policies.js +4 -5911
  68. package/dist/policy-config-form-BwyK7DGV.js +2502 -0
  69. package/dist/policy-config-form-BwyK7DGV.js.map +1 -0
  70. package/dist/policy-config-form-CefFo6Fw.cjs +2629 -0
  71. package/dist/policy-config-form-CefFo6Fw.cjs.map +1 -0
  72. package/dist/policy-types-D_sYWb-b.d.cts +81 -0
  73. package/dist/policy-types-D_sYWb-b.d.ts +81 -0
  74. package/dist/query-BmN_qO0W.js +171 -0
  75. package/dist/query-BmN_qO0W.js.map +1 -0
  76. package/dist/query-DU-KZleN.cjs +212 -0
  77. package/dist/query-DU-KZleN.cjs.map +1 -0
  78. package/dist/relationships-view-B5TAcPHU.cjs +2452 -0
  79. package/dist/relationships-view-B5TAcPHU.cjs.map +1 -0
  80. package/dist/relationships-view-DbwFh5r-.js +2417 -0
  81. package/dist/relationships-view-DbwFh5r-.js.map +1 -0
  82. package/dist/relationships.cjs +9 -4328
  83. package/dist/relationships.d.cts +93 -92
  84. package/dist/relationships.d.ts +93 -92
  85. package/dist/relationships.js +2 -4300
  86. package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
  87. package/dist/schema-builder-sidebar-Ctu621Vw.cjs +604 -0
  88. package/dist/schema-builder-sidebar-Ctu621Vw.cjs.map +1 -0
  89. package/dist/schema-builder-sidebar-VR-Ctidc.js +593 -0
  90. package/dist/schema-builder-sidebar-VR-Ctidc.js.map +1 -0
  91. package/dist/table-editor-C-hHz3DJ.cjs +1935 -0
  92. package/dist/table-editor-C-hHz3DJ.cjs.map +1 -0
  93. package/dist/table-editor-IVp3B4nG.js +1906 -0
  94. package/dist/table-editor-IVp3B4nG.js.map +1 -0
  95. package/dist/tables.cjs +6 -5643
  96. package/dist/tables.d.cts +22 -21
  97. package/dist/tables.d.ts +22 -21
  98. package/dist/tables.js +3 -5618
  99. package/dist/testing.cjs +63 -62
  100. package/dist/testing.cjs.map +1 -1
  101. package/dist/testing.d.cts +4 -4
  102. package/dist/testing.d.ts +4 -4
  103. package/dist/testing.js +62 -61
  104. package/dist/testing.js.map +1 -1
  105. package/dist/types-GUrH1Qny.d.cts +200 -0
  106. package/dist/types-GUrH1Qny.d.ts +200 -0
  107. package/dist/use-update-table-C7v3gRyG.cjs +291 -0
  108. package/dist/use-update-table-C7v3gRyG.cjs.map +1 -0
  109. package/dist/use-update-table-Dz6knGoH.js +244 -0
  110. package/dist/use-update-table-Dz6knGoH.js.map +1 -0
  111. package/package.json +6 -6
  112. package/dist/core.cjs.map +0 -1
  113. package/dist/core.js.map +0 -1
  114. package/dist/fields.cjs.map +0 -1
  115. package/dist/fields.js.map +0 -1
  116. package/dist/generated-types-CnAlqHU_.d.cts +0 -25
  117. package/dist/generated-types-CnAlqHU_.d.ts +0 -25
  118. package/dist/indexes.cjs.map +0 -1
  119. package/dist/indexes.js.map +0 -1
  120. package/dist/policies.cjs.map +0 -1
  121. package/dist/policies.js.map +0 -1
  122. package/dist/policy-types-CEYAR5TN.d.cts +0 -79
  123. package/dist/policy-types-CEYAR5TN.d.ts +0 -79
  124. package/dist/relationships.cjs.map +0 -1
  125. package/dist/relationships.js.map +0 -1
  126. package/dist/tables.cjs.map +0 -1
  127. package/dist/tables.js.map +0 -1
  128. package/dist/types-Du86atZ8.d.cts +0 -199
  129. package/dist/types-Du86atZ8.d.ts +0 -199
  130. package/dist/types-bX2dCrdl.d.cts +0 -52
  131. package/dist/types-bX2dCrdl.d.ts +0 -52
@@ -0,0 +1,27 @@
1
+ //#region src/compat/generated-types.d.ts
2
+ interface GeneratedNode {
3
+ [key: string]: any;
4
+ id: string;
5
+ name?: string | null;
6
+ label?: string | null;
7
+ description?: string | null;
8
+ databaseId?: string | null;
9
+ schemaId?: string | null;
10
+ tableId?: string | null;
11
+ ownerId?: string | null;
12
+ displayName?: string | null;
13
+ username?: string | null;
14
+ nodes?: GeneratedNode[] | null;
15
+ edges?: Array<{
16
+ node: GeneratedNode;
17
+ }> | null;
18
+ totalCount?: number | null;
19
+ pageInfo?: {
20
+ hasNextPage?: boolean | null;
21
+ hasPreviousPage?: boolean | null;
22
+ } | null;
23
+ }
24
+ type GeneratedMutationResult = Record<string, Record<string, GeneratedNode | null> | null>;
25
+ //#endregion
26
+ export { GeneratedNode as n, GeneratedMutationResult as t };
27
+ //# sourceMappingURL=generated-types-DZMUyNBH.d.cts.map
@@ -0,0 +1,27 @@
1
+ //#region src/compat/generated-types.d.ts
2
+ interface GeneratedNode {
3
+ [key: string]: any;
4
+ id: string;
5
+ name?: string | null;
6
+ label?: string | null;
7
+ description?: string | null;
8
+ databaseId?: string | null;
9
+ schemaId?: string | null;
10
+ tableId?: string | null;
11
+ ownerId?: string | null;
12
+ displayName?: string | null;
13
+ username?: string | null;
14
+ nodes?: GeneratedNode[] | null;
15
+ edges?: Array<{
16
+ node: GeneratedNode;
17
+ }> | null;
18
+ totalCount?: number | null;
19
+ pageInfo?: {
20
+ hasNextPage?: boolean | null;
21
+ hasPreviousPage?: boolean | null;
22
+ } | null;
23
+ }
24
+ type GeneratedMutationResult = Record<string, Record<string, GeneratedNode | null> | null>;
25
+ //#endregion
26
+ export { GeneratedNode as n, GeneratedMutationResult as t };
27
+ //# sourceMappingURL=generated-types-DZMUyNBH.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { g as SchemaBuilderOperationContext, j as SchemaBuilderVariables, n as SchemaBuilderAdapter, s as SchemaBuilderFeature, u as SchemaBuilderHostOptions, w as SchemaBuilderScope, y as SchemaBuilderPreferences } from "./types-GUrH1Qny.cjs";
2
+ import { ReactNode } from "react";
3
+ import { StoreApi } from "zustand/vanilla";
4
+ import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
5
+ //#region src/core/store.d.ts
6
+ interface SchemaBuilderStoreState {
7
+ scopeKey: string;
8
+ selectedTableId: string | null;
9
+ selectedFieldId: string | null;
10
+ currentDatabaseApi: unknown | null;
11
+ preferences: SchemaBuilderPreferences;
12
+ activeTab: string;
13
+ setSelectedTableId: (tableId: string | null) => void;
14
+ setSelectedFieldId: (fieldId: string | null) => void;
15
+ setCurrentDatabaseApi: (api: unknown | null) => void;
16
+ replacePreferences: (preferences: SchemaBuilderPreferences) => void;
17
+ replaceActiveTab: (tabId: string) => void;
18
+ replaceScope: (scope: SchemaBuilderScope) => void;
19
+ }
20
+ declare function getSchemaBuilderScopeKey(scope: SchemaBuilderScope): string;
21
+ declare function createSchemaBuilderStore(scope: SchemaBuilderScope, preferences: SchemaBuilderPreferences, activeTab: string, selectedTableId?: string | null): StoreApi<SchemaBuilderStoreState>;
22
+ //#endregion
23
+ //#region src/core/context.d.ts
24
+ interface SchemaBuilderContextValue extends SchemaBuilderHostOptions {
25
+ store: StoreApi<SchemaBuilderStoreState>;
26
+ setActiveTab: (tabId: string) => void;
27
+ setPreferences: (preferences: SchemaBuilderPreferences | ((current: SchemaBuilderPreferences) => SchemaBuilderPreferences)) => void;
28
+ selectTable: (tableId: string | null, tableName?: string | null) => void;
29
+ selectField: (fieldId: string | null) => void;
30
+ }
31
+ interface SchemaBuilderProviderProps extends SchemaBuilderHostOptions {
32
+ children: ReactNode;
33
+ }
34
+ declare function SchemaBuilderProvider({ children, tabs, ...host }: SchemaBuilderProviderProps): import("react").JSX.Element;
35
+ declare function useSchemaBuilder(): SchemaBuilderContextValue;
36
+ declare function useSchemaBuilderStore<T>(selector: (state: SchemaBuilderStoreState) => T): T;
37
+ //#endregion
38
+ //#region src/core/query.d.ts
39
+ type FeatureOperation$1<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
40
+ declare function schemaBuilderQueryKey(scope: {
41
+ orgId: string;
42
+ databaseId: string;
43
+ userId?: string | null;
44
+ }, feature: SchemaBuilderFeature, operation: string, variables?: SchemaBuilderVariables): readonly ["@constructive-io/schema-builder", string, string, string | null, keyof SchemaBuilderAdapter, string, object];
45
+ declare function useSchemaBuilderQuery<TData = unknown, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation$1<TFeature>, variables?: SchemaBuilderVariables, options?: Omit<UseQueryOptions<TData, Error, TData, ReturnType<typeof schemaBuilderQueryKey>>, 'queryKey' | 'queryFn'>): UseQueryResult<TData, Error>;
46
+ //#endregion
47
+ //#region src/core/mutation.d.ts
48
+ type FeatureOperation<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
49
+ type SchemaBuilderMutationOptions<TData, TVariables, TContext = unknown> = UseMutationOptions<TData, Error, TVariables, TContext> & {
50
+ /** Result fields required by generated GraphQL adapters for this mutation. */
51
+ selection?: SchemaBuilderOperationContext['selection'];
52
+ };
53
+ declare function useSchemaBuilderMutation<TData = unknown, TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation<TFeature>, options?: SchemaBuilderMutationOptions<TData, TVariables>): UseMutationResult<TData, Error, TVariables>;
54
+ //#endregion
55
+ export { SchemaBuilderContextValue as a, useSchemaBuilder as c, createSchemaBuilderStore as d, getSchemaBuilderScopeKey as f, useSchemaBuilderQuery as i, useSchemaBuilderStore as l, useSchemaBuilderMutation as n, SchemaBuilderProvider as o, schemaBuilderQueryKey as r, SchemaBuilderProviderProps as s, SchemaBuilderMutationOptions as t, SchemaBuilderStoreState as u };
56
+ //# sourceMappingURL=index-9h0EROdb.d.cts.map
@@ -0,0 +1,7 @@
1
+ import { b as SchemaBuilderProps } from "./types-GUrH1Qny.js";
2
+ import "./index-p_NegPQ5.js";
3
+ //#region src/components/schema-builder.d.ts
4
+ declare function SchemaBuilder({ className, emptyState, ...host }: SchemaBuilderProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { SchemaBuilder as t };
7
+ //# sourceMappingURL=index-CwQ9QpxA.d.ts.map
@@ -0,0 +1,56 @@
1
+ import "react";
2
+ //#region src/schema/schema-builder-core/lib/types/cell-types.d.ts
3
+ type CellType = 'text' | 'textarea' | 'email' | 'url' | 'phone' | 'citext' | 'bpchar' | 'number' | 'integer' | 'smallint' | 'decimal' | 'currency' | 'percentage' | 'date' | 'datetime' | 'time' | 'timestamptz' | 'interval' | 'boolean' | 'toggle' | 'bit' | 'json' | 'jsonb' | 'array' | 'text-array' | 'uuid-array' | 'number-array' | 'integer-array' | 'date-array' | 'geometry' | 'geometry-point' | 'geometry-collection' | 'inet' | 'image' | 'file' | 'video' | 'audio' | 'upload' | 'uuid' | 'color' | 'rating' | 'tags' | 'tsvector' | 'origin' | 'relation' | 'unknown';
4
+ //#endregion
5
+ //#region src/schema/schema-builder-core/lib/schema/types.d.ts
6
+ declare const RelationshipTypes: {
7
+ readonly ONE_TO_ONE: "one-to-one";
8
+ readonly BELONGS_TO: "belongs-to";
9
+ readonly ONE_TO_MANY: "one-to-many";
10
+ readonly MANY_TO_MANY: "many-to-many";
11
+ };
12
+ declare const ForeignKeyActions: {
13
+ readonly CASCADE: "c";
14
+ readonly RESTRICT: "r";
15
+ readonly SET_NULL: "n";
16
+ readonly SET_DEFAULT: "d";
17
+ readonly NO_ACTION: "a";
18
+ };
19
+ type RelationshipType = (typeof RelationshipTypes)[keyof typeof RelationshipTypes];
20
+ type ForeignKeyAction = (typeof ForeignKeyActions)[keyof typeof ForeignKeyActions];
21
+ interface FieldConstraints {
22
+ nullable?: boolean;
23
+ unique?: boolean;
24
+ primaryKey?: boolean;
25
+ defaultValue?: string | number | boolean | null;
26
+ minLength?: number;
27
+ maxLength?: number;
28
+ minValue?: number;
29
+ maxValue?: number;
30
+ pattern?: string;
31
+ enumValues?: string[];
32
+ precision?: number;
33
+ scale?: number;
34
+ checkExpression?: string;
35
+ }
36
+ interface FieldDefinition {
37
+ id: string;
38
+ name: string;
39
+ type: CellType;
40
+ label?: string;
41
+ description?: string;
42
+ constraints: FieldConstraints;
43
+ fieldOrder?: number;
44
+ isHidden?: boolean;
45
+ isRequired?: boolean;
46
+ metadata?: {
47
+ elementType?: CellType;
48
+ targetTable?: string;
49
+ targetField?: string;
50
+ geoType?: 'Point' | 'Polygon' | 'LineString' | 'MultiPoint' | 'MultiPolygon' | 'MultiLineString';
51
+ smartTags?: Record<string, unknown> | null;
52
+ };
53
+ }
54
+ //#endregion
55
+ export { ForeignKeyAction as n, RelationshipType as r, FieldDefinition as t };
56
+ //# sourceMappingURL=index-DOWB1UBK.d.cts.map
@@ -0,0 +1,56 @@
1
+ import "react";
2
+ //#region src/schema/schema-builder-core/lib/types/cell-types.d.ts
3
+ type CellType = 'text' | 'textarea' | 'email' | 'url' | 'phone' | 'citext' | 'bpchar' | 'number' | 'integer' | 'smallint' | 'decimal' | 'currency' | 'percentage' | 'date' | 'datetime' | 'time' | 'timestamptz' | 'interval' | 'boolean' | 'toggle' | 'bit' | 'json' | 'jsonb' | 'array' | 'text-array' | 'uuid-array' | 'number-array' | 'integer-array' | 'date-array' | 'geometry' | 'geometry-point' | 'geometry-collection' | 'inet' | 'image' | 'file' | 'video' | 'audio' | 'upload' | 'uuid' | 'color' | 'rating' | 'tags' | 'tsvector' | 'origin' | 'relation' | 'unknown';
4
+ //#endregion
5
+ //#region src/schema/schema-builder-core/lib/schema/types.d.ts
6
+ declare const RelationshipTypes: {
7
+ readonly ONE_TO_ONE: "one-to-one";
8
+ readonly BELONGS_TO: "belongs-to";
9
+ readonly ONE_TO_MANY: "one-to-many";
10
+ readonly MANY_TO_MANY: "many-to-many";
11
+ };
12
+ declare const ForeignKeyActions: {
13
+ readonly CASCADE: "c";
14
+ readonly RESTRICT: "r";
15
+ readonly SET_NULL: "n";
16
+ readonly SET_DEFAULT: "d";
17
+ readonly NO_ACTION: "a";
18
+ };
19
+ type RelationshipType = (typeof RelationshipTypes)[keyof typeof RelationshipTypes];
20
+ type ForeignKeyAction = (typeof ForeignKeyActions)[keyof typeof ForeignKeyActions];
21
+ interface FieldConstraints {
22
+ nullable?: boolean;
23
+ unique?: boolean;
24
+ primaryKey?: boolean;
25
+ defaultValue?: string | number | boolean | null;
26
+ minLength?: number;
27
+ maxLength?: number;
28
+ minValue?: number;
29
+ maxValue?: number;
30
+ pattern?: string;
31
+ enumValues?: string[];
32
+ precision?: number;
33
+ scale?: number;
34
+ checkExpression?: string;
35
+ }
36
+ interface FieldDefinition {
37
+ id: string;
38
+ name: string;
39
+ type: CellType;
40
+ label?: string;
41
+ description?: string;
42
+ constraints: FieldConstraints;
43
+ fieldOrder?: number;
44
+ isHidden?: boolean;
45
+ isRequired?: boolean;
46
+ metadata?: {
47
+ elementType?: CellType;
48
+ targetTable?: string;
49
+ targetField?: string;
50
+ geoType?: 'Point' | 'Polygon' | 'LineString' | 'MultiPoint' | 'MultiPolygon' | 'MultiLineString';
51
+ smartTags?: Record<string, unknown> | null;
52
+ };
53
+ }
54
+ //#endregion
55
+ export { ForeignKeyAction as n, RelationshipType as r, FieldDefinition as t };
56
+ //# sourceMappingURL=index-DOWB1UBK.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { b as SchemaBuilderProps } from "./types-GUrH1Qny.cjs";
2
+ import "./index-9h0EROdb.cjs";
3
+ //#region src/components/schema-builder.d.ts
4
+ declare function SchemaBuilder({ className, emptyState, ...host }: SchemaBuilderProps): import("react").JSX.Element;
5
+ //#endregion
6
+ export { SchemaBuilder as t };
7
+ //# sourceMappingURL=index-Dgb_e3AP.d.cts.map
@@ -0,0 +1,56 @@
1
+ import { g as SchemaBuilderOperationContext, j as SchemaBuilderVariables, n as SchemaBuilderAdapter, s as SchemaBuilderFeature, u as SchemaBuilderHostOptions, w as SchemaBuilderScope, y as SchemaBuilderPreferences } from "./types-GUrH1Qny.js";
2
+ import { ReactNode } from "react";
3
+ import { StoreApi } from "zustand/vanilla";
4
+ import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
5
+ //#region src/core/store.d.ts
6
+ interface SchemaBuilderStoreState {
7
+ scopeKey: string;
8
+ selectedTableId: string | null;
9
+ selectedFieldId: string | null;
10
+ currentDatabaseApi: unknown | null;
11
+ preferences: SchemaBuilderPreferences;
12
+ activeTab: string;
13
+ setSelectedTableId: (tableId: string | null) => void;
14
+ setSelectedFieldId: (fieldId: string | null) => void;
15
+ setCurrentDatabaseApi: (api: unknown | null) => void;
16
+ replacePreferences: (preferences: SchemaBuilderPreferences) => void;
17
+ replaceActiveTab: (tabId: string) => void;
18
+ replaceScope: (scope: SchemaBuilderScope) => void;
19
+ }
20
+ declare function getSchemaBuilderScopeKey(scope: SchemaBuilderScope): string;
21
+ declare function createSchemaBuilderStore(scope: SchemaBuilderScope, preferences: SchemaBuilderPreferences, activeTab: string, selectedTableId?: string | null): StoreApi<SchemaBuilderStoreState>;
22
+ //#endregion
23
+ //#region src/core/context.d.ts
24
+ interface SchemaBuilderContextValue extends SchemaBuilderHostOptions {
25
+ store: StoreApi<SchemaBuilderStoreState>;
26
+ setActiveTab: (tabId: string) => void;
27
+ setPreferences: (preferences: SchemaBuilderPreferences | ((current: SchemaBuilderPreferences) => SchemaBuilderPreferences)) => void;
28
+ selectTable: (tableId: string | null, tableName?: string | null) => void;
29
+ selectField: (fieldId: string | null) => void;
30
+ }
31
+ interface SchemaBuilderProviderProps extends SchemaBuilderHostOptions {
32
+ children: ReactNode;
33
+ }
34
+ declare function SchemaBuilderProvider({ children, tabs, ...host }: SchemaBuilderProviderProps): import("react").JSX.Element;
35
+ declare function useSchemaBuilder(): SchemaBuilderContextValue;
36
+ declare function useSchemaBuilderStore<T>(selector: (state: SchemaBuilderStoreState) => T): T;
37
+ //#endregion
38
+ //#region src/core/query.d.ts
39
+ type FeatureOperation$1<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
40
+ declare function schemaBuilderQueryKey(scope: {
41
+ orgId: string;
42
+ databaseId: string;
43
+ userId?: string | null;
44
+ }, feature: SchemaBuilderFeature, operation: string, variables?: SchemaBuilderVariables): readonly ["@constructive-io/schema-builder", string, string, string | null, keyof SchemaBuilderAdapter, string, object];
45
+ declare function useSchemaBuilderQuery<TData = unknown, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation$1<TFeature>, variables?: SchemaBuilderVariables, options?: Omit<UseQueryOptions<TData, Error, TData, ReturnType<typeof schemaBuilderQueryKey>>, 'queryKey' | 'queryFn'>): UseQueryResult<TData, Error>;
46
+ //#endregion
47
+ //#region src/core/mutation.d.ts
48
+ type FeatureOperation<TFeature extends SchemaBuilderFeature> = Extract<keyof SchemaBuilderAdapter[TFeature], string>;
49
+ type SchemaBuilderMutationOptions<TData, TVariables, TContext = unknown> = UseMutationOptions<TData, Error, TVariables, TContext> & {
50
+ /** Result fields required by generated GraphQL adapters for this mutation. */
51
+ selection?: SchemaBuilderOperationContext['selection'];
52
+ };
53
+ declare function useSchemaBuilderMutation<TData = unknown, TVariables extends SchemaBuilderVariables = SchemaBuilderVariables, TFeature extends SchemaBuilderFeature = SchemaBuilderFeature>(feature: TFeature, operation: FeatureOperation<TFeature>, options?: SchemaBuilderMutationOptions<TData, TVariables>): UseMutationResult<TData, Error, TVariables>;
54
+ //#endregion
55
+ export { SchemaBuilderContextValue as a, useSchemaBuilder as c, createSchemaBuilderStore as d, getSchemaBuilderScopeKey as f, useSchemaBuilderQuery as i, useSchemaBuilderStore as l, useSchemaBuilderMutation as n, SchemaBuilderProvider as o, schemaBuilderQueryKey as r, SchemaBuilderProviderProps as s, SchemaBuilderMutationOptions as t, SchemaBuilderStoreState as u };
56
+ //# sourceMappingURL=index-p_NegPQ5.d.ts.map