import { Position } from '../client/util/geometry';
import { Dict } from './Dict';
import { IO } from './IO';
import { IOOf, _IOOf } from './IOOf';
import { None } from './None';
import { UnitClass } from './UnitClass';
export declare type Type = string;
export declare type Types = Dict<Type>;
export declare type GraphUnitPinSpec = {
    data?: string;
    constant?: boolean | None;
    ignored?: boolean | None;
    memory?: boolean;
    metadata?: {
        position?: {
            x: number;
            y: number;
        };
    };
};
export declare type GraphUnitPinsSpec = Dict<GraphUnitPinSpec>;
export declare type PinSpecBase = {
    name?: string;
    optional?: boolean;
    functional?: boolean;
    defaultIgnored?: boolean;
    ref?: boolean;
    type?: string;
    init?: string;
    icon?: string;
    component?: boolean;
    metadata?: PinBaseMetadataSpec;
};
export declare type PinBaseMetadataSpec = NodeMetadataSpec & {
    examples?: any[];
    position?: Dict<Position>;
};
export declare type PinSpec = PinSpecBase | GraphPinSpec;
export declare type PinsSpecBase = Dict<PinSpecBase>;
export declare type GraphExposedMergeSpec = PinSpecBase & {
    mergeId: string;
    unitId?: undefined;
    pinId?: undefined;
};
export declare type GraphExposedLinkPinSpec = PinSpecBase & {
    unitId: string;
    pinId: string;
    mergeId?: undefined;
};
export declare type GraphExposedEmptyPinSpec = PinSpecBase & {
    unitId?: undefined;
    pinId?: undefined;
    mergeId?: undefined;
};
export declare type GraphSubPinSpec = GraphExposedMergeSpec | GraphExposedLinkPinSpec | GraphExposedEmptyPinSpec;
export declare type GraphPinSpec = PinSpecBase & {
    plug?: Dict<GraphSubPinSpec>;
};
export declare type GraphPinsSpec = Dict<GraphPinSpec>;
export declare type PinsSpec = Dict<PinSpec>;
export declare type Classes = Dict<UnitClass<any>>;
export declare type GraphUnitSpecBase = {
    input?: GraphUnitPinsSpec;
    output?: GraphUnitPinsSpec;
    state?: Dict<any>;
    memory?: {
        input: Dict<any>;
        output: Dict<any>;
        memory: Dict<any>;
    };
    flag?: Dict<any>;
    children?: GraphUnitSpec[] | None;
    reorder?: string[] | None;
};
export declare type GraphUnitSpec = GraphUnitSpecBase & {
    id: string;
    metadata?: GraphUnitMetadataSpec;
};
export declare type GraphUnitsSpec = Dict<GraphUnitSpec>;
export declare type GraphMergeSpec = Dict<GraphMergeUnitSpec>;
export declare type GraphMergeUnitSpec = _IOOf<Dict<true>>;
export declare type GraphMergesSpec = Dict<GraphMergeSpec>;
export declare type DatumSpec = string;
export declare type GraphDataSpec = Dict<DatumSpec>;
export declare type BaseSpec = {
    id: string;
    base: true;
    type?: string;
    method?: boolean;
    private?: boolean;
    system?: boolean;
    name: string;
    inputs: PinsSpecBase;
    outputs: PinsSpecBase;
    methods?: Dict<boolean>;
    metadata?: NodeMetadataSpec;
    render?: boolean;
    component?: ComponentSpec;
};
export declare type UnitInterfaceSpec = {
    inputs: PinsSpecBase;
    outputs: PinsSpecBase;
};
export declare type Artifact = 'spec' | 'component' | 'dir' | 'data';
export declare type GraphSpecBase = {
    merges?: GraphMergesSpec;
    inputs?: GraphPinsSpec;
    outputs?: GraphPinsSpec;
};
export declare type GraphSpec = GraphSpecBase & {
    base?: false;
    type?: '`U`&`G`' | '`U`&`G`&`C`';
    method?: boolean;
    private?: boolean;
    system?: boolean;
    fork?: boolean;
    units?: GraphUnitsSpec;
    name?: string;
    metadata?: GraphMetadataSpec;
    data?: GraphDataSpec;
    render?: boolean;
    component?: GraphComponentSpec;
    methods?: Dict<GraphSpec>;
    self?: string | None;
    id?: string;
    specs?: GraphSpecs;
};
export declare type BaseSpecs = {
    [path: string]: BaseSpec;
};
export declare type GraphSpecs = {
    [name: string]: GraphSpec;
};
export declare type Spec = BaseSpec | GraphSpec;
export declare type Specs = {
    [path: string]: Spec;
};
export declare type GraphMetadataSpec = NodeMetadataSpec & {
    position?: Dict<Dict<{
        x: number;
        y: number;
    }> | None>;
};
export declare type NodeMetadataSpec = {
    icon?: string | None;
    tags?: string[];
    description?: string | None;
    link?: string | None;
    globals?: string[];
    editor?: {
        on?: boolean;
        lit?: boolean;
        edit?: boolean;
    };
    complexity?: number;
};
export declare type Metadata = {
    rename: string;
    icon: string;
    description: string;
    complexity?: number;
};
export declare type SpecAction = {
    path: string;
    type: string;
    data: any;
};
export declare type Action = {
    type: string;
    data: any;
    group_id?: string;
};
export declare type BaseComponentSpec = {
    defaultWidth?: number;
    defaultHeight?: number;
};
export declare type BaseComponentSpecs = Dict<BaseComponentSpec>;
export declare type GraphSubComponentSpec = {
    width?: number;
    height?: number;
    children?: string[];
    childSlot?: Dict<string>;
    attr?: Dict<string>;
};
export declare type GraphSubComponentSpecs = Dict<GraphSubComponentSpec>;
export declare type GraphComponentSpec = BaseComponentSpec & {
    slots?: [string, string][];
    subComponents?: GraphSubComponentSpecs;
    children?: string[];
};
export declare type ComponentSpec = GraphComponentSpec | BaseComponentSpec;
export declare type ComponentSpecs = {
    [path: string]: ComponentSpec;
};
export declare type Email = string;
export declare type Comment = {
    author: Email;
    comment: string;
};
export declare type Comments = {
    [id: string]: Comment;
};
export declare type GraphUnitMetadataSpec = {
    component?: {
        width?: number;
        height?: number;
    };
    rename?: string | None;
    comment?: string | None;
    position?: {
        x: number;
        y: number;
    };
};
export declare type GraphUnitPinOuterSpec = {
    unitId: string;
    type: IO;
    pinId: string;
};
export declare type GraphPlugOuterSpec = {
    type: IO;
    pinId: string;
    subPinId: string;
};
export declare type GraphUnitOuterSpec = {
    merges: IOOf<Dict<{
        mergeId: string;
        otherPin: GraphUnitPinOuterSpec | null;
        exposedPin: GraphPlugOuterSpec | null;
    }>>;
    exposed: IOOf<Dict<GraphPlugOuterSpec>>;
};
