@babsey/code-graph 0.8.7 → 0.9.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 (81) hide show
  1. package/dist/code-graph.js +7 -7
  2. package/dist/code-graph.umd.cjs +1 -1
  3. package/dist/code.d.ts +57 -0
  4. package/dist/codeEditor.d.ts +28 -0
  5. package/dist/codeEngine/codeEngine.d.ts +16 -0
  6. package/dist/codeEngine/index.d.ts +3 -0
  7. package/dist/codeEngine/register.d.ts +11 -0
  8. package/dist/codeEngine/runEngine.command.d.ts +8 -0
  9. package/dist/codeGraph/codeGraph.d.ts +122 -0
  10. package/dist/codeGraph/codeGraphNode.d.ts +12 -0
  11. package/dist/codeGraph/codeGraphTemplate.d.ts +16 -0
  12. package/dist/codeGraph/index.d.ts +4 -0
  13. package/dist/codeGraph/switchCodeGraph.d.ts +8 -0
  14. package/dist/codeNode/codeNode.d.ts +138 -0
  15. package/dist/codeNode/defineCodeNode.d.ts +17 -0
  16. package/dist/codeNode/dynamicCodeNode.d.ts +34 -0
  17. package/dist/codeNode/index.d.ts +3 -0
  18. package/dist/codeNodeInterfaces/baseNumericInterface.d.ts +23 -0
  19. package/dist/codeNodeInterfaces/baseStringInterface.d.ts +5 -0
  20. package/dist/codeNodeInterfaces/checkbox/checkboxInterface.d.ts +5 -0
  21. package/dist/codeNodeInterfaces/codeNode/CodeNodeInterface.vue.d.ts +7 -0
  22. package/dist/codeNodeInterfaces/codeNode/codeNodeInterface.d.ts +21 -0
  23. package/dist/codeNodeInterfaces/codeNode/index.d.ts +2 -0
  24. package/dist/codeNodeInterfaces/codeNodeInput/codeNodeInputInterface.d.ts +6 -0
  25. package/dist/codeNodeInterfaces/codeNodeOutput/codeNodeOutputInterface.d.ts +9 -0
  26. package/dist/codeNodeInterfaces/createInterface.d.ts +12 -0
  27. package/dist/codeNodeInterfaces/index.d.ts +13 -0
  28. package/dist/codeNodeInterfaces/integer/integerInterface.d.ts +6 -0
  29. package/dist/codeNodeInterfaces/listInput/listInputInterface.d.ts +5 -0
  30. package/dist/codeNodeInterfaces/number/numberInterface.d.ts +5 -0
  31. package/dist/codeNodeInterfaces/select/selectInterface.d.ts +12 -0
  32. package/dist/codeNodeInterfaces/slider/sliderInterface.d.ts +9 -0
  33. package/dist/codeNodeInterfaces/textInput/TextInputInterface.vue.d.ts +26 -0
  34. package/dist/codeNodeInterfaces/textInput/textInputInterface.d.ts +7 -0
  35. package/dist/codeNodeInterfaces/textareaInput/textareaInputInterface.d.ts +5 -0
  36. package/dist/codeNodeInterfaces/tupleInput/tupleInputInterface.d.ts +5 -0
  37. package/dist/components/CodeGraphEditor.vue.d.ts +19 -0
  38. package/dist/components/dev/CodeGraphInfo.vue.d.ts +7 -0
  39. package/dist/components/editor/CodeEditor.vue.d.ts +19 -0
  40. package/dist/components/editor/CopyToClipboard.vue.d.ts +7 -0
  41. package/dist/components/index.d.ts +11 -0
  42. package/dist/components/nav/NavBar.vue.d.ts +29 -0
  43. package/dist/components/nav/NavItem.vue.d.ts +17 -0
  44. package/dist/components/node/CodeGraphNode.vue.d.ts +39 -0
  45. package/dist/components/nodeInterface/CodeGraphNodeInterface.vue.d.ts +19 -0
  46. package/dist/components/nodePalette/CodeNodePalette.vue.d.ts +3 -0
  47. package/dist/components/sidebar/CodeGraphSidebar.vue.d.ts +15 -0
  48. package/dist/components/sidebar/SidebarCheckbox.vue.d.ts +13 -0
  49. package/dist/components.d.ts +2 -0
  50. package/dist/icons/Check.vue.d.ts +3 -0
  51. package/dist/icons/CodeVariable.vue.d.ts +3 -0
  52. package/dist/icons/Copy.vue.d.ts +3 -0
  53. package/dist/icons/DotsVertical.vue.d.ts +3 -0
  54. package/dist/icons/Download.vue.d.ts +3 -0
  55. package/dist/icons/LayoutSidebarLeftCollapse.vue.d.ts +3 -0
  56. package/dist/icons/LayoutSidebarLeftExpand.vue.d.ts +3 -0
  57. package/dist/icons/LayoutSidebarRight.vue.d.ts +3 -0
  58. package/dist/icons/LayoutSidebarRightCollapse.vue.d.ts +3 -0
  59. package/dist/icons/LayoutSidebarRightExpand.vue.d.ts +3 -0
  60. package/dist/icons/LockCode.vue.d.ts +3 -0
  61. package/dist/icons/PlayerPlay.vue.d.ts +3 -0
  62. package/dist/icons/Plus.vue.d.ts +3 -0
  63. package/dist/icons/Restore.vue.d.ts +3 -0
  64. package/dist/icons/Schema.vue.d.ts +3 -0
  65. package/dist/icons/SchemaOff.vue.d.ts +3 -0
  66. package/dist/icons/TransitionBottom.vue.d.ts +3 -0
  67. package/dist/icons/Upload.vue.d.ts +3 -0
  68. package/dist/icons/X.vue.d.ts +3 -0
  69. package/dist/icons/index.d.ts +19 -0
  70. package/dist/index.d.ts +14 -0
  71. package/dist/interfaceTypes/default.d.ts +10 -0
  72. package/dist/interfaceTypes/index.d.ts +1 -0
  73. package/dist/settings.d.ts +15 -0
  74. package/dist/subgraph/createSubgraph.command.d.ts +6 -0
  75. package/dist/subgraph/graphInterface.d.ts +68 -0
  76. package/dist/subgraph/index.d.ts +3 -0
  77. package/dist/subgraph/subgraphInterfaceNodes.d.ts +27 -0
  78. package/dist/utils/download.d.ts +2 -0
  79. package/dist/utils/object.d.ts +7 -0
  80. package/dist/viewModel.d.ts +46 -0
  81. package/package.json +4 -3
@@ -0,0 +1,15 @@
1
+ declare var __VLS_25: {
2
+ node: import('baklavajs').AbstractNode;
3
+ };
4
+ type __VLS_Slots = {} & {
5
+ codeEditor?: (props: typeof __VLS_25) => any;
6
+ };
7
+ declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ disabled?: boolean;
3
+ inversed?: boolean;
4
+ modelValue: boolean;
5
+ name?: string;
6
+ };
7
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
+ "update:modelValue": (v: boolean) => any;
9
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export * from './components/index';
2
+ export { default as TextInputInterface } from './codeNodeInterfaces/textInput/TextInputInterface.vue';
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export { default as Check } from './Check.vue';
2
+ export { default as CodeVariable } from './CodeVariable.vue';
3
+ export { default as Copy } from './Copy.vue';
4
+ export { default as DotsVertical } from './DotsVertical.vue';
5
+ export { default as Download } from './Download.vue';
6
+ export { default as LayoutSidebarLeftCollapse } from './LayoutSidebarLeftCollapse.vue';
7
+ export { default as LayoutSidebarLeftExpand } from './LayoutSidebarLeftExpand.vue';
8
+ export { default as LayoutSidebarRight } from './LayoutSidebarRight.vue';
9
+ export { default as LayoutSidebarRightCollapse } from './LayoutSidebarRightCollapse.vue';
10
+ export { default as LayoutSidebarRightExpand } from './LayoutSidebarRightExpand.vue';
11
+ export { default as LockCode } from './LockCode.vue';
12
+ export { default as PlayerPlay } from './PlayerPlay.vue';
13
+ export { default as Plus } from './Plus.vue';
14
+ export { default as Restore } from './Restore.vue';
15
+ export { default as Schema } from './Schema.vue';
16
+ export { default as SchemaOff } from './SchemaOff.vue';
17
+ export { default as TransitionBottom } from './TransitionBottom.vue';
18
+ export { default as Upload } from './Upload.vue';
19
+ export { default as X } from './X.vue';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module @babsey/code-graph
3
+ */
4
+ export * as components from './components';
5
+ export * as icons from './icons';
6
+ export * from './code';
7
+ export * from './codeEngine';
8
+ export * from './codeGraph';
9
+ export * from './codeNode';
10
+ export * from './codeNodeInterfaces';
11
+ export * from './interfaceTypes';
12
+ export * from './settings';
13
+ export * from './subgraph';
14
+ export * from './viewModel';
@@ -0,0 +1,10 @@
1
+ import { NodeInterfaceType } from '@baklavajs/interface-types';
2
+ import { IBaklavaViewModel } from '@baklavajs/renderer-vue';
3
+ export declare const booleanType: NodeInterfaceType<boolean>;
4
+ export declare const dictType: NodeInterfaceType<object>;
5
+ export declare const listType: NodeInterfaceType<object>;
6
+ export declare const nodeType: NodeInterfaceType<null>;
7
+ export declare const numberType: NodeInterfaceType<number>;
8
+ export declare const stringType: NodeInterfaceType<string>;
9
+ export declare const tupleType: NodeInterfaceType<object>;
10
+ export declare const addDefaultInterfaceTypes: (baklavaView: IBaklavaViewModel) => void;
@@ -0,0 +1 @@
1
+ export * from './default';
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ import { ICommandHandler, IViewSettings } from '@baklavajs/renderer-vue';
3
+ import { CodeGraph } from './codeGraph';
4
+ export declare const CLEAR_ALL_COMMAND = "CLEAR_ALL";
5
+ export declare const DOWNLOAD_EDITOR_STATE_COMMAND = "DOWNLOAD_EDITOR_STATE";
6
+ export declare const RUN_ENGINE_COMMAND = "RUN_ENGINE";
7
+ export declare const TOGGLE_MINIMAP_COMMAND = "TOGGLE_MINIMAP";
8
+ export declare const TOGGLE_PALETTE_COMMAND = "TOGGLE_PALETTE";
9
+ export declare const UPLOAD_EDITOR_STATE_COMMAND = "UPLOAD_EDITOR_STATE";
10
+ /**
11
+ * Reister custom commands.
12
+ * @param viewModel view model instance
13
+ */
14
+ export declare const registerCustomCommands: (displayedGraph: Ref<CodeGraph>, handler: ICommandHandler, settings: IViewSettings) => void;
15
+ export declare const updateToolbarItems: (settings: IViewSettings) => void;
@@ -0,0 +1,6 @@
1
+ import { ICommand, ICommandHandler } from '@baklavajs/renderer-vue';
2
+ import { Ref } from 'vue';
3
+ import { SwitchCodeGraph, CodeGraph } from '../codeGraph';
4
+ export declare const CREATE_SUBGRAPH_COMMAND = "CREATE_SUBGRAPH";
5
+ export type CreateSubgraphCommand = ICommand<void>;
6
+ export declare function registerCreateSubgraphCommand(displayedGraph: Ref<CodeGraph>, handler: ICommandHandler, switchGraph: SwitchCodeGraph): void;
@@ -0,0 +1,68 @@
1
+ import { NodeInterface, CalculateFunction, IGraphInterface } from '@baklavajs/core';
2
+ import { AbstractCodeNode, CodeNode, ICodeNodeState } from '../codeNode';
3
+ export interface ICodeGraphInterface extends IGraphInterface {
4
+ id: string;
5
+ nodeId: string;
6
+ nodeInterfaceId: string;
7
+ name: string;
8
+ }
9
+ export declare const GRAPH_INPUT_NODE_TYPE = "__baklava_SubgraphInputNode";
10
+ export declare const GRAPH_OUTPUT_NODE_TYPE = "__baklava_SubgraphOutputNode";
11
+ interface IGraphInterfaceNodeState<I, O> extends ICodeNodeState<I, O> {
12
+ graphInterfaceId: string;
13
+ }
14
+ declare abstract class CodeGraphInterfaceNode<I, O> extends CodeNode<I, O> {
15
+ graphInterfaceId: string;
16
+ constructor();
17
+ onPlaced(): void;
18
+ load(state: IGraphInterfaceNodeState<I, O>): void;
19
+ save(): IGraphInterfaceNodeState<I, O>;
20
+ update(): void;
21
+ }
22
+ export declare class CodeGraphInputNode extends CodeGraphInterfaceNode<{
23
+ name: string;
24
+ }, {
25
+ placeholder: unknown;
26
+ }> {
27
+ static isGraphInputNode(v: AbstractCodeNode): v is CodeGraphInputNode;
28
+ readonly type = "__baklava_SubgraphInputNode";
29
+ inputs: {
30
+ name: NodeInterface<string>;
31
+ };
32
+ outputs: {
33
+ placeholder: NodeInterface<undefined>;
34
+ };
35
+ }
36
+ export type CodeGraphInputNodeState = IGraphInterfaceNodeState<{
37
+ name: string;
38
+ }, {
39
+ placeholder: unknown;
40
+ }>;
41
+ export declare class CodeGraphOutputNode extends CodeGraphInterfaceNode<{
42
+ name: string;
43
+ placeholder: unknown;
44
+ }, {
45
+ output: unknown;
46
+ }> {
47
+ static isGraphOutputNode(v: AbstractCodeNode): v is CodeGraphOutputNode;
48
+ readonly type = "__baklava_SubgraphOutputNode";
49
+ inputs: {
50
+ name: NodeInterface<string>;
51
+ placeholder: NodeInterface<undefined>;
52
+ };
53
+ outputs: {
54
+ output: NodeInterface<undefined>;
55
+ };
56
+ calculate: CalculateFunction<{
57
+ placeholder: unknown;
58
+ }, {
59
+ output: unknown;
60
+ }>;
61
+ }
62
+ export type CodeGraphOutputNodeState = IGraphInterfaceNodeState<{
63
+ name: string;
64
+ placeholder: unknown;
65
+ }, {
66
+ output: unknown;
67
+ }>;
68
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './createSubgraph.command';
2
+ export * from './graphInterface';
3
+ export * from './subgraphInterfaceNodes';
@@ -0,0 +1,27 @@
1
+ import { NodeInterface } from '@baklavajs/core';
2
+ import { TextInputInterface } from '@baklavajs/renderer-vue';
3
+ import { CodeGraphInputNode, CodeGraphOutputNode } from './graphInterface';
4
+ import { CodeNodeInterface } from '../codeNodeInterfaces';
5
+ export declare class SubgraphInputNode extends CodeGraphInputNode {
6
+ protected _title: string;
7
+ inputs: {
8
+ _code: CodeNodeInterface<string>;
9
+ name: TextInputInterface;
10
+ };
11
+ outputs: {
12
+ _code: CodeNodeInterface<string>;
13
+ placeholder: NodeInterface<undefined>;
14
+ };
15
+ }
16
+ export declare class SubgraphOutputNode extends CodeGraphOutputNode {
17
+ protected _title: string;
18
+ inputs: {
19
+ _code: CodeNodeInterface<string>;
20
+ name: TextInputInterface;
21
+ placeholder: NodeInterface<undefined>;
22
+ };
23
+ outputs: {
24
+ _code: CodeNodeInterface<string>;
25
+ output: NodeInterface<undefined>;
26
+ };
27
+ }
@@ -0,0 +1,2 @@
1
+ export declare const download: (data: string, filename?: string, format?: string) => void;
2
+ export declare const upload: (format?: string) => HTMLInputElement;
@@ -0,0 +1,7 @@
1
+ type Entry<T> = {
2
+ [K in keyof T]: [K, T[K]];
3
+ }[keyof T];
4
+ export declare function filterObject<T extends object>(obj: T, fn: (entry: Entry<T>, i: number, arr: Entry<T>[]) => boolean): Partial<T>;
5
+ /** Key type is limited due to https://github.com/microsoft/TypeScript/pull/37457 */
6
+ export declare function mapValues<I, O>(obj: Record<string, I>, fn: (value: I) => O): Record<string, O>;
7
+ export {};
@@ -0,0 +1,46 @@
1
+ import { IEditorState } from '@baklavajs/core';
2
+ import { SequentialHook } from '@baklavajs/events';
3
+ import { IClipboard, ICommandHandler, IHistory, IViewSettings } from '@baklavajs/renderer-vue';
4
+ import { AbstractCodeNode } from './codeNode';
5
+ import { CodeNodeInterface } from './codeNodeInterfaces';
6
+ import { Code } from './code';
7
+ import { CodeEditor } from './codeEditor';
8
+ import { CodeEngine } from './codeEngine';
9
+ import { CodeGraph, CodeGraphTemplate } from './codeGraph';
10
+ export interface ICodeGraphViewModel {
11
+ code: Code;
12
+ editor: CodeEditor;
13
+ /** Currently displayed graph */
14
+ displayedGraph: CodeGraph;
15
+ isReady: boolean;
16
+ /** True if the currently displayed graph is a subgraph, false if it is the root graph */
17
+ isSubgraph: Readonly<boolean>;
18
+ settings: IViewSettings;
19
+ commandHandler: ICommandHandler;
20
+ history: IHistory;
21
+ clipboard: IClipboard;
22
+ hooks: {
23
+ /** Called whenever a node is rendered */
24
+ renderNode: SequentialHook<{
25
+ node: AbstractCodeNode;
26
+ el: HTMLElement;
27
+ }, null>;
28
+ /** Called whenever an interface is rendered */
29
+ renderInterface: SequentialHook<{
30
+ intf: CodeNodeInterface<unknown>;
31
+ el: HTMLElement;
32
+ }, null>;
33
+ };
34
+ switchGraph: (newGraph: CodeGraph | CodeGraphTemplate) => void;
35
+ engine?: CodeEngine;
36
+ loadEditor?: (editorState: IEditorState) => void;
37
+ newGraph?: () => void;
38
+ subscribe?: () => void;
39
+ unsubscribe?: () => void;
40
+ onMounted: () => void;
41
+ onBeforeUnmount: () => void;
42
+ }
43
+ export declare function useCodeGraph(props?: {
44
+ existingEditor?: CodeEditor;
45
+ code?: Code;
46
+ }): ICodeGraphViewModel;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@babsey/code-graph",
3
- "version": "0.8.7",
3
+ "version": "0.9.1",
4
4
  "author": "babsey <spreizer@web.de>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
- "main": "./dist/code-mirror.umd.cjs",
10
+ "main": "./dist/code-graph.umd.cjs",
11
11
  "module": "./dist/code-graph.js",
12
12
  "types": "./dist/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
- "types": "./dist/lib/index.d.ts",
15
+ "types": "./dist/index.d.ts",
16
16
  "import": "./dist/code-graph.js",
17
17
  "require": "./dist/code-graph.umd.cjs"
18
18
  },
@@ -62,6 +62,7 @@
62
62
  "rimraf": "~6.1",
63
63
  "sass-embedded": "~1.97",
64
64
  "typescript": "~5.9",
65
+ "unplugin-dts": "^1.0.0-beta.6",
65
66
  "vite": "~7.3",
66
67
  "vite-plugin-vue-devtools": "~8.0",
67
68
  "vue-tsc": "~3.2"