Remove built *.d.ts files from the repo
This commit is contained in:
14
src/demo/app/app.component.d.ts
vendored
14
src/demo/app/app.component.d.ts
vendored
@@ -1,14 +0,0 @@
|
||||
import { Flo } from 'spring-flo';
|
||||
import { BsModalService } from 'ngx-bootstrap';
|
||||
export declare class AppComponent {
|
||||
private modelService;
|
||||
metamodel: Flo.Metamodel;
|
||||
renderer: Flo.Renderer;
|
||||
editor: Flo.Editor;
|
||||
dsl: string;
|
||||
dslEditor: boolean;
|
||||
private editorContext;
|
||||
paletteSize: number;
|
||||
constructor(modelService: BsModalService);
|
||||
arrangeAll(): void;
|
||||
}
|
||||
2
src/demo/app/app.module.d.ts
vendored
2
src/demo/app/app.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class AppModule {
|
||||
}
|
||||
36
src/demo/app/editor.d.ts
vendored
36
src/demo/app/editor.d.ts
vendored
@@ -1,36 +0,0 @@
|
||||
import { Flo } from 'spring-flo';
|
||||
import { dia } from 'jointjs';
|
||||
import { BsModalService } from 'ngx-bootstrap';
|
||||
/**
|
||||
* @author Alex Boyko
|
||||
* @author Andy Clement
|
||||
*/
|
||||
export declare class Editor implements Flo.Editor {
|
||||
private modelService;
|
||||
constructor(modelService: BsModalService);
|
||||
createHandles(context: Flo.EditorContext, createHandle: (owner: dia.CellView, kind: string, action: () => void, location: dia.Point) => void, owner: dia.CellView): void;
|
||||
openPropertiesDialog(cell: dia.Cell): void;
|
||||
validatePort(context: Flo.EditorContext, view: dia.ElementView, magnet: SVGElement): boolean;
|
||||
validateLink(context: Flo.EditorContext, cellViewS: dia.ElementView, magnetS: SVGElement, cellViewT: dia.ElementView, magnetT: SVGElement, isSource: boolean, linkView: dia.LinkView): boolean;
|
||||
preDelete(context: Flo.EditorContext, deletedElement: dia.Cell): void;
|
||||
handleNodeDropping(context: Flo.EditorContext, dragDescriptor: Flo.DnDDescriptor): void;
|
||||
calculateDragDescriptor(context: Flo.EditorContext, draggedView: dia.CellView, targetUnderMouse: dia.CellView, point: dia.Point, sourceComponent: string): Flo.DnDDescriptor;
|
||||
validate(graph: dia.Graph): Promise<Map<string, Array<Flo.Marker>>>;
|
||||
moveNodeOnNode(context: Flo.EditorContext, node: dia.Element, pivotNode: dia.Element, side: string, shouldRepairDamage: boolean): void;
|
||||
/**
|
||||
* Node moved onto a link. Remove the existing link and replace it with two links
|
||||
* that go from the original link source to the dropped node and from the dropped node
|
||||
* to the original link target.
|
||||
*/
|
||||
moveNodeOnLink(context: Flo.EditorContext, node: dia.Element, link: dia.Link, shouldRepairDamage: boolean): void;
|
||||
/**
|
||||
* When a node is removed any dangling links should be removed. What this function will also try to do
|
||||
* is if removing a node from a chain it will attempt to replace dangling links with a link from the
|
||||
* deleted nodes original source to the deleted nodes original target.
|
||||
*/
|
||||
repairDamage(context: Flo.EditorContext, node: dia.Element): void;
|
||||
/**
|
||||
* Check if node being dropped and drop target node next to each other such that they won't be swapped by the drop
|
||||
*/
|
||||
canSwap(context: Flo.EditorContext, dropee: dia.Element, target: dia.Element, side: string): boolean;
|
||||
}
|
||||
2
src/demo/app/graph-to-text.d.ts
vendored
2
src/demo/app/graph-to-text.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { dia } from 'jointjs';
|
||||
export declare function convertGraphToText(g: dia.Graph): string;
|
||||
13
src/demo/app/properties.dialog.component.d.ts
vendored
13
src/demo/app/properties.dialog.component.d.ts
vendored
@@ -1,13 +0,0 @@
|
||||
import { BsModalRef } from 'ngx-bootstrap';
|
||||
import { Properties } from 'spring-flo';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
export declare class PropertiesDialogComponent {
|
||||
private bsModalRef;
|
||||
title: string;
|
||||
propertiesGroupModel: Properties.PropertiesGroupModel;
|
||||
propertiesFormGroup: FormGroup;
|
||||
constructor(bsModalRef: BsModalRef);
|
||||
handleOk(): void;
|
||||
handleCancel(): void;
|
||||
readonly okDisabled: boolean;
|
||||
}
|
||||
17
src/demo/app/renderer.d.ts
vendored
17
src/demo/app/renderer.d.ts
vendored
@@ -1,17 +0,0 @@
|
||||
import { Flo } from 'spring-flo';
|
||||
import { dia } from 'jointjs';
|
||||
/**
|
||||
* @author Alex Boyko
|
||||
* @author Andy Clement
|
||||
*/
|
||||
export declare class Renderer implements Flo.Renderer {
|
||||
createHandle(kind: string): dia.Element;
|
||||
createDecoration(kind: string): dia.Element;
|
||||
createNode(metadata: Flo.ElementMetadata, props: Map<string, any>): dia.Element;
|
||||
initializeNewNode(node: dia.Element, viewerDescriptor: Flo.ViewerDescriptor): void;
|
||||
createLink(source: Flo.LinkEnd, target: Flo.LinkEnd, metadata: Flo.ElementMetadata, props: Map<string, any>): dia.Link;
|
||||
isSemanticProperty(propertyPath: string, element: dia.Cell): boolean;
|
||||
refreshVisuals(cell: dia.Cell, propertyPath: string, paper: dia.Paper): void;
|
||||
layout(paper: dia.Paper): Promise<{}>;
|
||||
getLinkAnchorPoint(linkView: dia.LinkView, view: dia.ElementView, magnet: SVGElement, reference: dia.Point): dia.Point;
|
||||
}
|
||||
2
src/demo/app/text-to-graph.d.ts
vendored
2
src/demo/app/text-to-graph.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
import { Flo } from 'spring-flo';
|
||||
export declare function convertTextToGraph(flo: Flo.EditorContext, metamodel: Map<string, Map<string, Flo.ElementMetadata>>, input: string): void;
|
||||
0
src/demo/main.d.ts
vendored
0
src/demo/main.d.ts
vendored
10
src/lib/index.d.ts
vendored
10
src/lib/index.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
export { FloModule } from './src/module';
|
||||
export { Palette } from './src/palette/palette.component';
|
||||
export { EditorComponent } from './src/editor/editor.component';
|
||||
export { DslEditorComponent } from './src/dsl-editor/dsl.editor.component';
|
||||
export { Constants } from './src/shared/shapes';
|
||||
export { PropertiesGroupComponent } from './src/properties/properties.group.component';
|
||||
export { DynamicFormPropertyComponent } from './src/properties/df.property.component';
|
||||
export { ResizerDirective } from './src/directives/resizer';
|
||||
export * from './src/shared/flo.common';
|
||||
export * from './src/shared/flo.properties';
|
||||
30
src/lib/src/directives/resizer.d.ts
vendored
30
src/lib/src/directives/resizer.d.ts
vendored
@@ -1,30 +0,0 @@
|
||||
import { EventEmitter, ElementRef, OnInit, OnDestroy } from '@angular/core';
|
||||
import 'rxjs/add/operator/sampleTime';
|
||||
import 'rxjs/add/observable/fromEvent';
|
||||
import 'rxjs/Rx';
|
||||
export declare class ResizerDirective implements OnInit, OnDestroy {
|
||||
private element;
|
||||
private document;
|
||||
private dragInProgress;
|
||||
private vertical;
|
||||
private first;
|
||||
private second;
|
||||
private _size;
|
||||
private _splitSize;
|
||||
private _subscriptions;
|
||||
private mouseMoveHandler;
|
||||
maxSplitSize: number;
|
||||
splitSize: number;
|
||||
sizeChange: EventEmitter<number>;
|
||||
resizerWidth: number;
|
||||
resizerHeight: number;
|
||||
resizerLeft: string;
|
||||
resizerTop: string;
|
||||
resizerRight: string;
|
||||
resizerBottom: string;
|
||||
constructor(element: ElementRef, document: any);
|
||||
private startDrag();
|
||||
private mousemove(event);
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
}
|
||||
31
src/lib/src/dsl-editor/dsl.editor.component.d.ts
vendored
31
src/lib/src/dsl-editor/dsl.editor.component.d.ts
vendored
@@ -1,31 +0,0 @@
|
||||
/// <reference types="codemirror" />
|
||||
import { ElementRef, OnInit, OnDestroy } from '@angular/core';
|
||||
import 'rxjs/add/operator/debounceTime';
|
||||
import * as CodeMirror from 'codemirror';
|
||||
import 'codemirror/addon/lint/lint';
|
||||
import 'codemirror/addon/hint/show-hint';
|
||||
import 'codemirror/addon/display/placeholder';
|
||||
import 'codemirror/addon/scroll/annotatescrollbar';
|
||||
import 'codemirror/addon/scroll/simplescrollbars';
|
||||
export declare class DslEditorComponent implements OnInit, OnDestroy {
|
||||
private element;
|
||||
private doc;
|
||||
private _dsl;
|
||||
private _lint;
|
||||
private _hint;
|
||||
private lineNumbers;
|
||||
private lineWrapping;
|
||||
private scrollbarStyle;
|
||||
private placeholder;
|
||||
private debounce;
|
||||
private dslChange;
|
||||
private focus;
|
||||
private blur;
|
||||
private _dslChangedHandler;
|
||||
constructor(element: ElementRef);
|
||||
dsl: string;
|
||||
lintOptions: boolean | CodeMirror.LintOptions;
|
||||
hintOptions: any;
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
}
|
||||
179
src/lib/src/editor/editor.component.d.ts
vendored
179
src/lib/src/editor/editor.component.d.ts
vendored
@@ -1,179 +0,0 @@
|
||||
import { ElementRef, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import 'rxjs/add/operator/debounceTime';
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from './../shared/flo.common';
|
||||
export interface VisibilityState {
|
||||
visibility: string;
|
||||
children: Array<VisibilityState>;
|
||||
}
|
||||
export declare class EditorComponent implements OnInit, OnDestroy, OnChanges {
|
||||
private element;
|
||||
/**
|
||||
* Metamodel. Retrieves metadata about elements that can be shown in Flo
|
||||
*/
|
||||
private metamodel;
|
||||
/**
|
||||
* Renders elements.
|
||||
*/
|
||||
private renderer;
|
||||
/**
|
||||
* Editor. Provides domain specific editing capabilities on top of standard Flo features
|
||||
*/
|
||||
private editor;
|
||||
/**
|
||||
* Size (Width) of the palette
|
||||
*/
|
||||
private paletteSize;
|
||||
/**
|
||||
* Min zoom percent value
|
||||
*/
|
||||
private minZoom;
|
||||
/**
|
||||
* Max zoom percent value
|
||||
*/
|
||||
private maxZoom;
|
||||
/**
|
||||
* Zoom percent increment/decrement step
|
||||
*/
|
||||
private zoomStep;
|
||||
private paperPadding;
|
||||
floApi: EventEmitter<Flo.EditorContext>;
|
||||
/**
|
||||
* Joint JS Graph object representing the Graph model
|
||||
*/
|
||||
private graph;
|
||||
/**
|
||||
* Joint JS Paper object representing the canvas control containing the graph view
|
||||
*/
|
||||
private paper;
|
||||
/**
|
||||
* Currently selected element
|
||||
*/
|
||||
private _selection;
|
||||
/**
|
||||
* Current DnD descriptor for frag in progress
|
||||
*/
|
||||
private highlighted;
|
||||
/**
|
||||
* Flag specifying whether the Flo-Editor is in read-only mode.
|
||||
*/
|
||||
private _readOnlyCanvas;
|
||||
/**
|
||||
* Grid size
|
||||
*/
|
||||
private _gridSize;
|
||||
private _hiddenPalette;
|
||||
private editorContext;
|
||||
private _resizeHandler;
|
||||
private textToGraphEventEmitter;
|
||||
private graphToTextEventEmitter;
|
||||
private _graphToTextSyncEnabled;
|
||||
private validationEventEmitter;
|
||||
private _disposables;
|
||||
private _dslText;
|
||||
private dslChange;
|
||||
constructor(element: ElementRef);
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
ngOnChanges(changes: SimpleChanges): void;
|
||||
noPalette: boolean;
|
||||
graphToTextSync: boolean;
|
||||
createHandle(element: dia.CellView, kind: string, action: () => void, location: dia.Point): dia.Element;
|
||||
removeEmbeddedChildrenOfType(element: dia.Cell, types: Array<string>): void;
|
||||
selection: dia.CellView;
|
||||
readOnlyCanvas: boolean;
|
||||
/**
|
||||
* Displays graphical feedback for the drag and drop in progress based on current drag and drop descriptor object
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
showDragFeedback(dragDescriptor: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Hides graphical feedback for the drag and drop in progress based on current drag and drop descriptor object
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
hideDragFeedback(dragDescriptor: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Sets the new DnD info object - the descriptor for DnD
|
||||
*
|
||||
* @param dragDescriptor DnD info object. Has on info on graph node being dragged (drag source) and what it is
|
||||
* being dragged over at the moment (drop target)
|
||||
*/
|
||||
setDragDescriptor(dragDescriptor: Flo.DnDDescriptor): void;
|
||||
/**
|
||||
* Handles DnD events when a node is being dragged over canvas
|
||||
*
|
||||
* @param draggedView The Joint JS view object being dragged
|
||||
* @param targetUnderMouse The Joint JS view under mouse cursor
|
||||
* @param x X coordinate of the mouse on the canvas
|
||||
* @param y Y coordinate of the mosue on the canvas
|
||||
* @param context DnD context (palette or canvas)
|
||||
*/
|
||||
handleNodeDragging(draggedView: dia.CellView, targetUnderMouse: dia.CellView, x: number, y: number, sourceComponent: string): void;
|
||||
/**
|
||||
* Handles DnD drop event when a node is being dragged and dropped on the main canvas
|
||||
*/
|
||||
handleNodeDropping(): void;
|
||||
/**
|
||||
* Hides DOM Node (used to determine drop target DOM element)
|
||||
* @param domNode DOM node to hide
|
||||
* @returns {{visibility: *, children: Array}}
|
||||
* @private
|
||||
*/
|
||||
private _hideNode(domNode);
|
||||
/**
|
||||
* Restored DOM node original visibility (used to determine drop target DOM element)
|
||||
* @param domNode DOM node to restore visibility of
|
||||
* @param oldVisibility original visibility parameter
|
||||
* @private
|
||||
*/
|
||||
_restoreNodeVisibility(domNode: HTMLElement, oldVisibility: VisibilityState): void;
|
||||
/**
|
||||
* Unfortunately we can't just use event.target because often draggable shape on the canvas overlaps the target.
|
||||
* We can easily find the element(s) at location, but only nodes :-( Unclear how to find links at location
|
||||
* (bounding box of a link for testing is bad).
|
||||
* The result of that is that links can only be the drop target when dragging from the palette currently.
|
||||
* When DnDing shapes on the canvas drop target cannot be a link.
|
||||
*
|
||||
* Excluded views enables you to choose to filter some possible answers (useful in the case where elements are stacked
|
||||
* - e.g. Drag-n-Drop)
|
||||
*/
|
||||
getTargetViewFromEvent(event: MouseEvent, x: number, y: number, excludeViews?: Array<dia.CellView>): dia.CellView;
|
||||
handleDnDFromPalette(dndEvent: Flo.DnDEvent): void;
|
||||
handleDragFromPalette(dnDEvent: Flo.DnDEvent): void;
|
||||
createNode(metadata: Flo.ElementMetadata, props: Map<string, any>, position: dia.Point): dia.Element;
|
||||
createLink(source: Flo.LinkEnd, target: Flo.LinkEnd, metadata: Flo.ElementMetadata, props: Map<string, any>): dia.Link;
|
||||
handleDropFromPalette(event: Flo.DnDEvent): void;
|
||||
autosizePaper(): void;
|
||||
fitToPage(): void;
|
||||
zoomPercent: number;
|
||||
gridSize: number;
|
||||
validateGraph(): void;
|
||||
markElement(cell: dia.Cell, markers: Array<Flo.Marker>): void;
|
||||
doLayout(): Promise<void>;
|
||||
dsl: string;
|
||||
/**
|
||||
* Ask the server to parse the supplied text into a JSON graph of nodes and links,
|
||||
* then update the view based on that new information.
|
||||
*
|
||||
* @param {string} definition A flow definition (could be any format the server 'parse' endpoint understands)
|
||||
*/
|
||||
updateGraphRepresentation(): void;
|
||||
updateTextRepresentation(): void;
|
||||
initMetamodel(): void;
|
||||
initGraph(): void;
|
||||
postValidation(): void;
|
||||
handleNodeCreation(node: dia.Element): void;
|
||||
/**
|
||||
* Forwards a link event occurrence to any handlers in the editor service, if they are defined. Event examples
|
||||
* are 'change:source', 'change:target'.
|
||||
*/
|
||||
handleLinkEvent(event: string, link: dia.Link): void;
|
||||
handleLinkCreation(link: dia.Link): void;
|
||||
initGraphListeners(): void;
|
||||
initPaperListeners(): void;
|
||||
initPaper(): void;
|
||||
}
|
||||
2
src/lib/src/module.d.ts
vendored
2
src/lib/src/module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class FloModule {
|
||||
}
|
||||
49
src/lib/src/palette/palette.component.d.ts
vendored
49
src/lib/src/palette/palette.component.d.ts
vendored
@@ -1,49 +0,0 @@
|
||||
import { ElementRef, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import 'rxjs/add/operator/debounceTime';
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from './../shared/flo.common';
|
||||
export declare class Palette implements OnInit, OnDestroy, OnChanges {
|
||||
private element;
|
||||
private document;
|
||||
private static MetamodelListener;
|
||||
metamodel: Flo.Metamodel;
|
||||
renderer: Flo.Renderer;
|
||||
paletteEntryPadding: dia.Size;
|
||||
paletteSize: number;
|
||||
onPaletteEntryDrop: EventEmitter<Flo.DnDEvent>;
|
||||
private _paletteSize;
|
||||
private _filterText;
|
||||
private paletteGraph;
|
||||
private palette;
|
||||
private filterTextModel;
|
||||
private mouseMoveHanlder;
|
||||
private mouseUpHanlder;
|
||||
private _metamodelListener;
|
||||
/**
|
||||
* The names of any groups in the palette that have been deliberately closed (the arrow clicked on)
|
||||
* @type {String[]}
|
||||
*/
|
||||
private closedGroups;
|
||||
/**
|
||||
* Model of the clicked element
|
||||
*/
|
||||
private clickedElement;
|
||||
private viewBeingDragged;
|
||||
constructor(element: ElementRef, document: any);
|
||||
ngOnInit(): void;
|
||||
ngOnDestroy(): void;
|
||||
ngOnChanges(changes: SimpleChanges): void;
|
||||
private createPaletteGroup(title, isOpen);
|
||||
private createPaletteEntry(title, metadata);
|
||||
private buildPalette(metamodel);
|
||||
rebuildPalette(): void;
|
||||
filterText: string;
|
||||
private getPaletteView(view);
|
||||
private handleMouseUp(event);
|
||||
private trigger(event);
|
||||
private handleDrag(event);
|
||||
private rotateOpen(element);
|
||||
private doRotateOpen(element, angle);
|
||||
private doRotateClose(element, angle);
|
||||
private rotateClosed(element);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { FormGroup, AbstractControl } from '@angular/forms';
|
||||
import { Properties } from './../shared/flo.properties';
|
||||
export declare class DynamicFormPropertyComponent {
|
||||
model: Properties.ControlModel<any>;
|
||||
form: FormGroup;
|
||||
constructor();
|
||||
readonly types: typeof Properties.InputType;
|
||||
readonly control: AbstractControl;
|
||||
readonly errorData: any[];
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { OnInit } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Properties } from './../shared/flo.properties';
|
||||
export declare class PropertiesGroupComponent implements OnInit {
|
||||
propertiesGroupModel: Properties.PropertiesGroupModel;
|
||||
form: FormGroup;
|
||||
private formEventEmitter;
|
||||
ngOnInit(): void;
|
||||
createGroupControls(): void;
|
||||
}
|
||||
181
src/lib/src/shared/flo.common.d.ts
vendored
181
src/lib/src/shared/flo.common.d.ts
vendored
@@ -1,181 +0,0 @@
|
||||
import { dia } from 'jointjs';
|
||||
export declare namespace Flo {
|
||||
enum DnDEventType {
|
||||
DRAG = 0,
|
||||
DROP = 1,
|
||||
}
|
||||
interface DnDEvent {
|
||||
type: DnDEventType;
|
||||
view: dia.CellView;
|
||||
event: MouseEvent;
|
||||
}
|
||||
interface PropertyMetadata {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description?: string;
|
||||
readonly defaultValue?: any;
|
||||
readonly [propName: string]: any;
|
||||
}
|
||||
interface ExtraMetadata {
|
||||
readonly titleProperty: string;
|
||||
readonly noEditableProps: boolean;
|
||||
readonly noPaletteEntry: boolean;
|
||||
readonly [propName: string]: any;
|
||||
readonly allowAdditionalProperties: boolean;
|
||||
}
|
||||
interface ElementMetadata {
|
||||
readonly name: string;
|
||||
readonly group: string;
|
||||
description?(): Promise<string>;
|
||||
get(property: String): Promise<PropertyMetadata>;
|
||||
properties(): Promise<Array<PropertyMetadata>>;
|
||||
readonly metadata?: ExtraMetadata;
|
||||
readonly [propName: string]: any;
|
||||
}
|
||||
interface ViewerDescriptor {
|
||||
readonly graph: dia.Graph;
|
||||
readonly paper?: dia.Paper;
|
||||
}
|
||||
interface MetamodelListener {
|
||||
metadataError(data: any): void;
|
||||
metadataAboutToChange(): void;
|
||||
metadataChanged(data: MetadataChangedData): void;
|
||||
}
|
||||
interface MetadataChangedData {
|
||||
readonly old: Map<string, Map<string, ElementMetadata>>;
|
||||
readonly new: Map<string, Map<string, ElementMetadata>>;
|
||||
readonly [propName: string]: any;
|
||||
}
|
||||
interface Definition {
|
||||
text: string;
|
||||
name?: string;
|
||||
[propName: string]: any;
|
||||
}
|
||||
interface Metamodel {
|
||||
textToGraph(flo: EditorContext, dsl: string): void;
|
||||
graphToText(flo: EditorContext): Promise<string>;
|
||||
load(): Promise<Map<string, Map<string, ElementMetadata>>>;
|
||||
groups(): Array<string>;
|
||||
refresh?(): Promise<Map<string, Map<string, ElementMetadata>>>;
|
||||
subscribe?(listener: MetamodelListener): void;
|
||||
unsubscribe?(listener: MetamodelListener): void;
|
||||
encodeTextToDSL?(text: string): string;
|
||||
decodeTextFromDSL?(dsl: string): string;
|
||||
isValidPropertyValue?(element: dia.Element, property: string, value: any): boolean;
|
||||
}
|
||||
interface CreationParams {
|
||||
metadata?: ElementMetadata;
|
||||
props?: Map<string, any>;
|
||||
}
|
||||
interface ElementCreationParams extends CreationParams {
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface LinkCreationParams extends CreationParams {
|
||||
source: string;
|
||||
target: string;
|
||||
}
|
||||
interface EmbeddedChildCreationParams extends CreationParams {
|
||||
parent: dia.Cell;
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface DecorationCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
messages: Array<string>;
|
||||
}
|
||||
interface HandleCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
}
|
||||
interface Renderer {
|
||||
createNode?(metadata: ElementMetadata, props: Map<string, any>): dia.Element;
|
||||
createLink?(source: LinkEnd, target: LinkEnd, metadata: ElementMetadata, props: Map<string, any>): dia.Link;
|
||||
createHandle?(kind: string, parent: dia.Cell): dia.Element;
|
||||
createDecoration?(kind: string, parent: dia.Cell): dia.Element;
|
||||
initializeNewNode?(node: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewLink?(link: dia.Link, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewHandle?(handle: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
initializeNewDecoration?(decoration: dia.Element, viewerDescriptor: ViewerDescriptor): void;
|
||||
getNodeView?(): dia.ElementView;
|
||||
getLinkView?(): dia.LinkView;
|
||||
layout?(paper: dia.Paper): Promise<any>;
|
||||
handleLinkEvent?(paper: dia.Paper, event: string, link: dia.Link): void;
|
||||
isSemanticProperty?(propertyPath: string, element: dia.Cell): boolean;
|
||||
refreshVisuals?(cell: dia.Cell, propertyPath: string, paper: dia.Paper): void;
|
||||
getLinkAnchorPoint?(linkView: dia.LinkView, view: dia.ElementView, port: SVGElement, reference: dia.Point): dia.Point;
|
||||
}
|
||||
interface EditorContext {
|
||||
zoomPercent: number;
|
||||
gridSize: number;
|
||||
readOnlyCanvas: boolean;
|
||||
selection: dia.CellView;
|
||||
graphToTextSync: boolean;
|
||||
noPalette: boolean;
|
||||
setDsl(dsl: string): void;
|
||||
updateGraph(): void;
|
||||
updateText(): void;
|
||||
performLayout(): Promise<void>;
|
||||
clearGraph(): void;
|
||||
getGraph(): dia.Graph;
|
||||
getPaper(): dia.Paper;
|
||||
getMinZoom(): number;
|
||||
getMaxZoom(): number;
|
||||
getZoomStep(): number;
|
||||
fitToPage(): void;
|
||||
createNode(metadata: ElementMetadata, props: Map<string, any>, position: dia.Point): dia.Element;
|
||||
createLink(source: LinkEnd, target: LinkEnd, metadata: ElementMetadata, props: Map<string, any>): dia.Link;
|
||||
deleteSelectedNode(): void;
|
||||
postValidation(): void;
|
||||
}
|
||||
interface LinkEndDescriptor {
|
||||
view: dia.CellView;
|
||||
cssClassSelector?: string;
|
||||
}
|
||||
interface DnDDescriptor {
|
||||
context?: string;
|
||||
range?: number;
|
||||
source?: LinkEndDescriptor;
|
||||
target?: LinkEndDescriptor;
|
||||
}
|
||||
interface LinkEnd {
|
||||
id: string;
|
||||
selector?: string;
|
||||
port?: string;
|
||||
}
|
||||
enum Severity {
|
||||
Error = 0,
|
||||
Warning = 1,
|
||||
}
|
||||
interface Marker {
|
||||
severity: Severity;
|
||||
message: string;
|
||||
range?: any;
|
||||
}
|
||||
interface Editor {
|
||||
interactive?: ((cellView: dia.CellView, event: string) => boolean) | boolean | {
|
||||
vertexAdd?: boolean;
|
||||
vertexMove?: boolean;
|
||||
vertexRemove?: boolean;
|
||||
arrowheadMove?: boolean;
|
||||
};
|
||||
allowLinkVertexEdit?: boolean;
|
||||
highlighting?: any;
|
||||
createHandles?(context: EditorContext, createHandle: (owner: dia.CellView, kind: string, action: () => void, location: dia.Point) => void, owner: dia.CellView): void;
|
||||
validatePort?(context: EditorContext, view: dia.ElementView, magnet: SVGElement): boolean;
|
||||
validateLink?(context: EditorContext, cellViewS: dia.ElementView, portS: SVGElement, cellViewT: dia.ElementView, portT: SVGElement, isSource: boolean, linkView: dia.LinkView): boolean;
|
||||
calculateDragDescriptor?(context: EditorContext, draggedView: dia.CellView, targetUnderMouse: dia.CellView, coordinate: dia.Point, sourceComponent: string): DnDDescriptor;
|
||||
handleNodeDropping?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
showDragFeedback?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
hideDragFeedback?(context: EditorContext, dragDescriptor: DnDDescriptor): void;
|
||||
validate?(graph: dia.Graph): Promise<Map<string, Array<Marker>>>;
|
||||
preDelete?(context: EditorContext, deletedElement: dia.Cell): void;
|
||||
setDefaultContent?(editorContext: EditorContext, data: Map<string, Map<string, ElementMetadata>>): void;
|
||||
}
|
||||
function findMagnetByClass(view: dia.CellView, className: string): HTMLElement;
|
||||
function findMagnetByPort(view: dia.CellView, port: string): HTMLElement;
|
||||
/**
|
||||
* Return the metadata for a particular palette entry in a particular group.
|
||||
* @param {String} name - name of the palette entry
|
||||
* @param {string} group - group in which the palette entry should exist (e.g. sinks)
|
||||
* @return {{name:string,group:string,unresolved:Boolean}}
|
||||
*/
|
||||
function getMetadata(metamodel: Map<string, Map<string, ElementMetadata>>, name: string, group: string): ElementMetadata;
|
||||
}
|
||||
68
src/lib/src/shared/flo.properties.d.ts
vendored
68
src/lib/src/shared/flo.properties.d.ts
vendored
@@ -1,68 +0,0 @@
|
||||
import { dia } from 'jointjs';
|
||||
import { ValidatorFn, AsyncValidatorFn } from '@angular/forms';
|
||||
import { Flo } from './../shared/flo.common';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
export declare namespace Properties {
|
||||
enum InputType {
|
||||
TEXT = 0,
|
||||
NUMBER = 1,
|
||||
SELECT = 2,
|
||||
CHECKBOX = 3,
|
||||
EMAIL = 4,
|
||||
URL = 5,
|
||||
CODE = 6,
|
||||
}
|
||||
interface Property {
|
||||
id: string;
|
||||
name: string;
|
||||
attr: string;
|
||||
description?: string;
|
||||
defaultValue?: any;
|
||||
value?: any;
|
||||
}
|
||||
interface ErrorData {
|
||||
id: string;
|
||||
message: string;
|
||||
}
|
||||
interface Validation {
|
||||
validator?: ValidatorFn | ValidatorFn[] | null;
|
||||
asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null;
|
||||
errorData?: Array<ErrorData>;
|
||||
}
|
||||
interface ControlModel<T> {
|
||||
readonly type: InputType;
|
||||
readonly id: string;
|
||||
value: T;
|
||||
readonly defaultValue: T;
|
||||
readonly name?: string;
|
||||
readonly description?: string;
|
||||
readonly property: Property;
|
||||
readonly validation?: Validation;
|
||||
}
|
||||
class GenericControlModel<T> implements ControlModel<T> {
|
||||
private _property;
|
||||
type: InputType;
|
||||
constructor(_property: Property, type: InputType);
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly description: string;
|
||||
readonly defaultValue: any;
|
||||
value: T;
|
||||
readonly property: Property;
|
||||
}
|
||||
class PropertiesGroupModel {
|
||||
protected cell: dia.Cell;
|
||||
protected controlModels: Array<ControlModel<any>>;
|
||||
protected loading: boolean;
|
||||
protected _loadedSubject: Subject<boolean>;
|
||||
constructor(cell: dia.Cell);
|
||||
private init();
|
||||
readonly isLoading: boolean;
|
||||
readonly loadedSubject: Subject<boolean>;
|
||||
getControlsModels(): ControlModel<any>[];
|
||||
protected createProperties(): Promise<Array<Property>>;
|
||||
protected createProperty(metadata: Flo.PropertyMetadata): Property;
|
||||
protected createControlModel(property: Property): ControlModel<any>;
|
||||
applyChanges(): void;
|
||||
}
|
||||
}
|
||||
47
src/lib/src/shared/shapes.d.ts
vendored
47
src/lib/src/shared/shapes.d.ts
vendored
@@ -1,47 +0,0 @@
|
||||
import { dia } from 'jointjs';
|
||||
import { Flo } from './flo.common';
|
||||
export declare namespace Constants {
|
||||
const REMOVE_HANDLE_TYPE = "remove";
|
||||
const PROPERTIES_HANDLE_TYPE = "properties";
|
||||
const ERROR_DECORATION_KIND = "error";
|
||||
const PALETTE_CONTEXT = "palette";
|
||||
const CANVAS_CONTEXT = "canvas";
|
||||
}
|
||||
export declare namespace Shapes {
|
||||
interface CreationParams extends Flo.CreationParams {
|
||||
renderer?: Flo.Renderer;
|
||||
paper?: dia.Paper;
|
||||
graph?: dia.Graph;
|
||||
}
|
||||
interface ElementCreationParams extends CreationParams {
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface LinkCreationParams extends CreationParams {
|
||||
source: Flo.LinkEnd;
|
||||
target: Flo.LinkEnd;
|
||||
}
|
||||
interface EmbeddedChildCreationParams extends CreationParams {
|
||||
parent: dia.Cell;
|
||||
position?: dia.Point;
|
||||
}
|
||||
interface DecorationCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
messages: Array<string>;
|
||||
}
|
||||
interface HandleCreationParams extends EmbeddedChildCreationParams {
|
||||
kind: string;
|
||||
}
|
||||
interface FilterOptions {
|
||||
amount: number;
|
||||
[propName: string]: any;
|
||||
}
|
||||
class Factory {
|
||||
/**
|
||||
* Create a JointJS node that embeds extra metadata (properties).
|
||||
*/
|
||||
static createNode(params: ElementCreationParams): dia.Element;
|
||||
static createLink(params: LinkCreationParams): dia.Link;
|
||||
static createDecoration(params: DecorationCreationParams): dia.Element;
|
||||
static createHandle(params: HandleCreationParams): dia.Element;
|
||||
}
|
||||
}
|
||||
1
src/lib/typings.d.ts
vendored
1
src/lib/typings.d.ts
vendored
@@ -1 +0,0 @@
|
||||
// You can add project typings here.
|
||||
Reference in New Issue
Block a user