Line data Source code
1 : /** Node slot type - input or output */
2 2356 : export enum NodeSlotType {
3 2356 : INPUT = 1,
4 2356 : OUTPUT = 2
5 : }
6 :
7 : /** Shape that an object will render as - used by nodes and slots */
8 2356 : export enum RenderShape {
9 : /** Rectangle with square corners */
10 2356 : BOX = 1,
11 : /** Rounded rectangle */
12 2356 : ROUND = 2,
13 : /** Circle is circle */
14 2356 : CIRCLE = 3,
15 : /** Two rounded corners: top left & bottom right */
16 2356 : CARD = 4,
17 : /** Slot shape: Arrow */
18 2356 : ARROW = 5,
19 : /** Slot shape: Grid */
20 2356 : GRID = 6,
21 : /** Slot shape: Hollow circle */
22 2356 : HollowCircle = 7
23 : }
24 :
25 : /** Bit flags used to indicate what the pointer is currently hovering over. */
26 2356 : export enum CanvasItem {
27 : /** No items / none */
28 2356 : Nothing = 0,
29 : /** At least one node */
30 2356 : Node = 1,
31 : /** At least one group */
32 2356 : Group = 1 << 1,
33 : /** A reroute (not its path) */
34 2356 : Reroute = 1 << 2,
35 : /** The path of a link */
36 2356 : Link = 1 << 3,
37 : /** A reroute slot */
38 2356 : RerouteSlot = 1 << 5,
39 : /** A subgraph input or output node */
40 2356 : SubgraphIoNode = 1 << 6,
41 : /** A subgraph input or output slot */
42 2356 : SubgraphIoSlot = 1 << 7
43 : }
44 :
45 : /** The direction that a link point will flow towards - e.g. horizontal outputs are right by default */
46 2356 : export enum LinkDirection {
47 2356 : NONE = 0,
48 2356 : UP = 1,
49 2356 : DOWN = 2,
50 2356 : LEFT = 3,
51 2356 : RIGHT = 4,
52 2356 : CENTER = 5
53 : }
54 :
55 : /** The path calculation that links follow */
56 2356 : export enum LinkRenderType {
57 2356 : HIDDEN_LINK = -1,
58 : /** Juts out from the input & output a little @see LinkDirection, then a straight line between them */
59 2356 : STRAIGHT_LINK = 0,
60 : /** 90° angles, clean and box-like */
61 2356 : LINEAR_LINK = 1,
62 : /** Smooth curved links - default */
63 2356 : SPLINE_LINK = 2
64 : }
65 :
66 : /** The marker in the middle of a link */
67 2356 : export enum LinkMarkerShape {
68 : /** Do not display markers */
69 2356 : None = 0,
70 : /** Circles (default) */
71 2356 : Circle = 1,
72 : /** Directional arrows */
73 2356 : Arrow = 2
74 : }
75 :
76 2356 : export enum TitleMode {
77 2356 : NORMAL_TITLE = 0,
78 2356 : NO_TITLE = 1,
79 2356 : TRANSPARENT_TITLE = 2,
80 2356 : AUTOHIDE_TITLE = 3
81 : }
82 :
83 2356 : export enum LGraphEventMode {
84 2356 : ALWAYS = 0,
85 2356 : ON_EVENT = 1,
86 2356 : NEVER = 2,
87 2356 : ON_TRIGGER = 3,
88 2356 : BYPASS = 4
89 : }
90 :
91 2356 : export enum EaseFunction {
92 2356 : EASE_IN_OUT_QUAD = 'easeInOutQuad'
93 : }
94 :
95 : /** Bit flags used to indicate what the pointer is currently hovering over. */
96 2356 : export enum Alignment {
97 : /** No items / none */
98 2356 : None = 0,
99 : /** Top */
100 2356 : Top = 1,
101 : /** Bottom */
102 2356 : Bottom = 1 << 1,
103 : /** Vertical middle */
104 2356 : Middle = 1 << 2,
105 : /** Left */
106 2356 : Left = 1 << 3,
107 : /** Right */
108 2356 : Right = 1 << 4,
109 : /** Horizontal centre */
110 2356 : Centre = 1 << 5,
111 : /** Top left */
112 2356 : TopLeft = Top | Left,
113 : /** Top side, horizontally centred */
114 2356 : TopCentre = Top | Centre,
115 : /** Top right */
116 2356 : TopRight = Top | Right,
117 : /** Left side, vertically centred */
118 2356 : MidLeft = Left | Middle,
119 : /** Middle centre */
120 2356 : MidCentre = Middle | Centre,
121 : /** Right side, vertically centred */
122 2356 : MidRight = Right | Middle,
123 : /** Bottom left */
124 2356 : BottomLeft = Bottom | Left,
125 : /** Bottom side, horizontally centred */
126 2356 : BottomCentre = Bottom | Centre,
127 : /** Bottom right */
128 2356 : BottomRight = Bottom | Right
129 : }
130 :
131 : /**
132 : * Checks if the bitwise {@link flag} is set in the {@link flagSet}.
133 : * @param flagSet The unknown set of flags - will be checked for the presence of {@link flag}
134 : * @param flag The flag to check for
135 : * @returns `true` if the flag is set, `false` otherwise.
136 : */
137 945 : export function hasFlag(flagSet: number, flag: number): boolean {
138 945 : return (flagSet & flag) === flag
139 : }
|