@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
87 lines (86 loc) • 2.93 kB
TypeScript
import { Node, type NodeParams, type SocketsValues } from '../Node.svelte';
import type { DataType } from '../../plugins/typed-sockets';
import { XMLData } from './XMLData';
import { type Scalar, type Socket, Control } from '../../socket';
import 'regenerator-runtime/runtime';
import { ComplexType, XmlSchema, type Attribute, type SaveData } from '@selenite/commons';
import { SvelteSet } from 'svelte/reactivity';
export declare class AddXmlAttributeControl extends Control {
readonly xmlNode: XmlNode;
constructor(xmlNode: XmlNode);
}
export type XmlConfig = {
complex: ComplexType | SaveData<ComplexType>;
typePaths: string[][] | 'infinite';
priorities?: Record<string, Record<string, number>>;
outLabel?: string;
};
export type XmlNodeParams = NodeParams & {
xmlConfig: XmlConfig;
schema?: XmlSchema;
initialValues?: Record<string, unknown>;
};
export declare class XmlToString extends Node<{
xml: Scalar<'xmlElement:*'>;
}, {
value: Scalar<'string'>;
}> {
constructor(params?: NodeParams);
data(inputs?: SocketsValues<{
xml: Scalar<'xmlElement:*'>;
}> | undefined): SocketsValues<{
value: Scalar<'string'>;
}>;
}
export declare class XmlNode extends Node<Record<string, Socket<DataType>>, {
value: Scalar;
name: Scalar<'groupNameRef'>;
}, {
addXmlAttr: AddXmlAttributeControl;
}, {
attributeValues: Record<string, unknown>;
usedOptionalAttrs: string[];
}> {
addOptionalAttribute(name: string): void;
addAllOptionalAttributes(): void;
removeOptionalAttribute(name: string): void;
removeAllOptionalAttributes(): void;
static counts: Record<string, number>;
xmlTag: string;
xmlInputs: Record<string, {
tag?: string;
}>;
xmlProperties: Set<string>;
optionalXmlAttributes: Set<string>;
usedOptionalAttrs: SvelteSet<string>;
xmlVectorProperties: Set<string>;
hasName: boolean;
geosSchema: XmlSchema | undefined;
set name(n: string);
get name(): string | undefined;
toJSON(): SaveData<Node>;
childrenSockets: Map<string, string>;
complex: ComplexType;
outLabel: string;
typePaths: string[][] | 'infinite' | undefined;
constructor(xmlNodeParams: XmlNodeParams);
getXml(): Promise<string>;
setName(name: string): void;
addInAttribute({ name, type, default: default_, required, doc, initialValues }: Attribute & {
initialValues?: Record<string, unknown>;
}): void;
data(inputs?: Record<string, unknown>): {
value: XMLData;
name?: string;
};
getProperties(inputs?: Record<string, unknown>): Record<string, unknown>;
addXmlInData({ name, tag, type, isArray, index, required, description }: {
name: string;
tag?: string;
type?: DataType;
isArray?: boolean;
index?: number;
required?: boolean;
description?: string;
}): void;
}