onejs-core 3.0.3 → 3.0.4
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.
- package/.gitattributes +2 -2
- package/.prettierrc +5 -5
- package/.vscode/settings.json +5 -5
- package/LICENSE +20 -20
- package/README.md +102 -102
- package/definitions/Assemblies/OneJS.Runtime.Ext.d.ts +6 -6
- package/definitions/Assemblies/OneJS.Runtime.d.ts +826 -826
- package/definitions/Assemblies/OneJS.Samples.d.ts +20 -20
- package/definitions/Assemblies/Unity.Mathematics.d.ts +9221 -9221
- package/definitions/Assemblies/UnityEditor.CoreModule.d.ts +32614 -32614
- package/definitions/Assemblies/UnityEngine.AIModule.d.ts +998 -998
- package/definitions/Assemblies/UnityEngine.AnimationModule.d.ts +3308 -3308
- package/definitions/Assemblies/UnityEngine.AssetBundleModule.d.ts +337 -337
- package/definitions/Assemblies/UnityEngine.AudioModule.d.ts +1154 -1154
- package/definitions/Assemblies/UnityEngine.CoreModule.d.ts +29587 -29587
- package/definitions/Assemblies/UnityEngine.PhysicsModule.d.ts +3137 -3137
- package/definitions/Assemblies/UnityEngine.TerrainModule.d.ts +1270 -1270
- package/definitions/Assemblies/UnityEngine.UIElementsModule.d.ts +32718 -32718
- package/definitions/Assemblies/UnityEngine.UnityAnalyticsCommonModule.d.ts +274 -274
- package/definitions/Assemblies/index.d.ts +16 -16
- package/definitions/Assemblies/mscorlib.d.ts +19416 -19416
- package/definitions/augments.d.ts +66 -66
- package/definitions/globals.d.ts +53 -53
- package/definitions/index.d.ts +11 -11
- package/definitions/jsx.d.ts +570 -570
- package/definitions/modules.d.ts +32 -32
- package/definitions/onejs.d.ts +171 -171
- package/definitions/preact.jsx.d.ts +6 -6
- package/definitions/proto-overrides.d.ts +41 -41
- package/definitions/puerts.d.ts +30 -30
- package/definitions/unity-engine.d.ts +22 -22
- package/dist/csharp/index.d.ts +3 -0
- package/dist/csharp/index.js +3 -0
- package/dist/dom/document.d.ts +30 -0
- package/dist/dom/document.js +89 -0
- package/dist/dom/dom-style.d.ts +9 -0
- package/dist/dom/dom-style.js +27 -0
- package/dist/dom/dom.d.ts +83 -0
- package/dist/dom/dom.js +313 -0
- package/dist/dom/index.d.ts +4 -0
- package/dist/dom/index.js +4 -0
- package/dist/dom/selector.d.ts +0 -0
- package/dist/dom/selector.js +0 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +45 -0
- package/dist/math/index.d.ts +86 -0
- package/dist/math/index.js +361 -0
- package/dist/preloads/inject.d.ts +3 -0
- package/dist/preloads/inject.js +36 -0
- package/dist/styling/index.d.ts +10 -0
- package/dist/styling/index.js +28 -0
- package/dist/styling/utils/generateAlphabeticName.d.ts +1 -0
- package/dist/styling/utils/generateAlphabeticName.js +16 -0
- package/dist/styling/utils/generateComponentId.d.ts +1 -0
- package/dist/styling/utils/generateComponentId.js +5 -0
- package/dist/styling/utils/hash.d.ts +5 -0
- package/dist/styling/utils/hash.js +34 -0
- package/dist/utils/arrays.d.ts +1 -0
- package/dist/utils/arrays.js +10 -0
- package/dist/utils/color-palettes.d.ts +2 -0
- package/dist/utils/color-palettes.js +2 -0
- package/dist/utils/color-parser.d.ts +161 -0
- package/dist/utils/color-parser.js +241 -0
- package/dist/utils/float-parser.d.ts +7 -0
- package/dist/utils/float-parser.js +23 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/responsive.d.ts +4 -0
- package/dist/utils/responsive.js +23 -0
- package/dist/utils/subscribe.d.ts +4 -0
- package/dist/utils/subscribe.js +10 -0
- package/dist/utils/system.d.ts +1 -0
- package/dist/utils/system.js +16 -0
- package/dist/utils/toJsArray.d.ts +1 -0
- package/dist/utils/toJsArray.js +10 -0
- package/dom/document.ts +115 -115
- package/dom/dom-style.ts +36 -36
- package/dom/dom.ts +376 -376
- package/dom/index.ts +3 -3
- package/index.ts +59 -59
- package/jsr.json +9 -9
- package/math/README.md +212 -212
- package/math/index.ts +487 -487
- package/package.json +33 -33
- package/preloads/inject.ts +43 -43
- package/scripts/esbuild/copy-assets.mjs +94 -94
- package/scripts/esbuild/decorator-fix.mjs +17 -17
- package/scripts/esbuild/import-transform.mjs +100 -100
- package/scripts/esbuild/index.mjs +3 -3
- package/scripts/esbuild/watch-output.mjs +38 -38
- package/scripts/postcss/cleanup-plugin.cjs +89 -89
- package/scripts/postcss/onejs-tw-config.cjs +252 -252
- package/scripts/postcss/optional-import-plugin.cjs +26 -26
- package/scripts/postcss/tailwind-logging-plugin.cjs +11 -11
- package/scripts/postcss/unwrap-is-plugin.cjs +16 -16
- package/scripts/postcss/uss-transform-plugin.cjs +92 -92
- package/scripts/switch.cjs +290 -290
- package/styling/index.tsx +32 -32
- package/styling/utils/generateAlphabeticName.ts +20 -20
- package/styling/utils/generateComponentId.ts +5 -5
- package/styling/utils/hash.ts +46 -46
- package/tsconfig.json +24 -24
- package/typings.d.ts +5 -5
- package/utils/arrays.ts +10 -10
- package/utils/color-palettes.ts +2 -2
- package/utils/color-parser.ts +248 -248
- package/utils/float-parser.ts +30 -30
- package/utils/index.ts +15 -15
- package/utils/subscribe.ts +16 -16
- package/utils/system.ts +16 -16
package/definitions/jsx.d.ts
CHANGED
|
@@ -1,571 +1,571 @@
|
|
|
1
|
-
type Texture = CS.UnityEngine.Texture
|
|
2
|
-
type Sprite = CS.UnityEngine.Sprite
|
|
3
|
-
type Rect = CS.UnityEngine.Rect
|
|
4
|
-
type Vector2 = CS.UnityEngine.Vector2
|
|
5
|
-
type Vector2Int = CS.UnityEngine.Vector2Int
|
|
6
|
-
type Vector3 = CS.UnityEngine.Vector3
|
|
7
|
-
type Vector3Int = CS.UnityEngine.Vector3Int
|
|
8
|
-
type Vector4 = CS.UnityEngine.Vector4
|
|
9
|
-
type RectInt = CS.UnityEngine.RectInt
|
|
10
|
-
type Bounds = CS.UnityEngine.Bounds
|
|
11
|
-
type BoundsInt = CS.UnityEngine.BoundsInt
|
|
12
|
-
type Texture2D = CS.UnityEngine.Texture2D
|
|
13
|
-
|
|
14
|
-
type TouchScreenKeyboardType = CS.UnityEngine.TouchScreenKeyboardType
|
|
15
|
-
|
|
16
|
-
type AttachToPanelEvent = CS.UnityEngine.UIElements.AttachToPanelEvent
|
|
17
|
-
type BlurEvent = CS.UnityEngine.UIElements.BlurEvent
|
|
18
|
-
type ChangeEvent<T> = CS.UnityEngine.UIElements.ChangeEvent<T>
|
|
19
|
-
type ClickEvent = CS.UnityEngine.UIElements.ClickEvent
|
|
20
|
-
type CustomStyleResolvedEvent = CS.UnityEngine.UIElements.CustomStyleResolvedEvent
|
|
21
|
-
type DetachFromPanelEvent = CS.UnityEngine.UIElements.DetachFromPanelEvent
|
|
22
|
-
type DragEnterEvent = CS.UnityEngine.UIElements.DragEnterEvent
|
|
23
|
-
type DragExitedEvent = CS.UnityEngine.UIElements.DragExitedEvent
|
|
24
|
-
type DragLeaveEvent = CS.UnityEngine.UIElements.DragLeaveEvent
|
|
25
|
-
type DragPerformEvent = CS.UnityEngine.UIElements.DragPerformEvent
|
|
26
|
-
type DragUpdatedEvent = CS.UnityEngine.UIElements.DragUpdatedEvent
|
|
27
|
-
type ExecuteCommandEvent = CS.UnityEngine.UIElements.ExecuteCommandEvent
|
|
28
|
-
type FocusEvent = CS.UnityEngine.UIElements.FocusEvent
|
|
29
|
-
type FocusInEvent = CS.UnityEngine.UIElements.FocusInEvent
|
|
30
|
-
type FocusOutEvent = CS.UnityEngine.UIElements.FocusOutEvent
|
|
31
|
-
type GeometryChangedEvent = CS.UnityEngine.UIElements.GeometryChangedEvent
|
|
32
|
-
type InputEvent = CS.UnityEngine.UIElements.InputEvent
|
|
33
|
-
type KeyDownEvent = CS.UnityEngine.UIElements.KeyDownEvent
|
|
34
|
-
type KeyUpEvent = CS.UnityEngine.UIElements.KeyUpEvent
|
|
35
|
-
type MouseCaptureEvent = CS.UnityEngine.UIElements.MouseCaptureEvent
|
|
36
|
-
type MouseCaptureOutEvent = CS.UnityEngine.UIElements.MouseCaptureOutEvent
|
|
37
|
-
type MouseDownEvent = CS.UnityEngine.UIElements.MouseDownEvent
|
|
38
|
-
type MouseEnterEvent = CS.UnityEngine.UIElements.MouseEnterEvent
|
|
39
|
-
type MouseEnterWindowEvent = CS.UnityEngine.UIElements.MouseEnterWindowEvent
|
|
40
|
-
type MouseLeaveEvent = CS.UnityEngine.UIElements.MouseLeaveEvent
|
|
41
|
-
type MouseLeaveWindowEvent = CS.UnityEngine.UIElements.MouseLeaveWindowEvent
|
|
42
|
-
type MouseMoveEvent = CS.UnityEngine.UIElements.MouseMoveEvent
|
|
43
|
-
type MouseOutEvent = CS.UnityEngine.UIElements.MouseOutEvent
|
|
44
|
-
type MouseOverEvent = CS.UnityEngine.UIElements.MouseOverEvent
|
|
45
|
-
type MouseUpEvent = CS.UnityEngine.UIElements.MouseUpEvent
|
|
46
|
-
type NavigationCancelEvent = CS.UnityEngine.UIElements.NavigationCancelEvent
|
|
47
|
-
type NavigationMoveEvent = CS.UnityEngine.UIElements.NavigationMoveEvent
|
|
48
|
-
type NavigationSubmitEvent = CS.UnityEngine.UIElements.NavigationSubmitEvent
|
|
49
|
-
type PickingMode = CS.UnityEngine.UIElements.PickingMode
|
|
50
|
-
type PointerCancelEvent = CS.UnityEngine.UIElements.PointerCancelEvent
|
|
51
|
-
type PointerCaptureEvent = CS.UnityEngine.UIElements.PointerCaptureEvent
|
|
52
|
-
type PointerCaptureOutEvent = CS.UnityEngine.UIElements.PointerCaptureOutEvent
|
|
53
|
-
type PointerDownEvent = CS.UnityEngine.UIElements.PointerDownEvent
|
|
54
|
-
type PointerEnterEvent = CS.UnityEngine.UIElements.PointerEnterEvent
|
|
55
|
-
type PointerLeaveEvent = CS.UnityEngine.UIElements.PointerLeaveEvent
|
|
56
|
-
type PointerMoveEvent = CS.UnityEngine.UIElements.PointerMoveEvent
|
|
57
|
-
type PointerOutEvent = CS.UnityEngine.UIElements.PointerOutEvent
|
|
58
|
-
type PointerOverEvent = CS.UnityEngine.UIElements.PointerOverEvent
|
|
59
|
-
type PointerStationaryEvent = CS.UnityEngine.UIElements.PointerStationaryEvent
|
|
60
|
-
type PointerUpEvent = CS.UnityEngine.UIElements.PointerUpEvent
|
|
61
|
-
type ScrollViewMode = CS.UnityEngine.UIElements.ScrollViewMode
|
|
62
|
-
type ScrollerVisibility = CS.UnityEngine.UIElements.ScrollerVisibility
|
|
63
|
-
type TouchScrollBehavior = CS.UnityEngine.UIElements.ScrollView.TouchScrollBehavior
|
|
64
|
-
type TooltipEvent = CS.UnityEngine.UIElements.TooltipEvent
|
|
65
|
-
type TransitionCancelEvent = CS.UnityEngine.UIElements.TransitionCancelEvent
|
|
66
|
-
type TransitionEndEvent = CS.UnityEngine.UIElements.TransitionEndEvent
|
|
67
|
-
type TransitionRunEvent = CS.UnityEngine.UIElements.TransitionRunEvent
|
|
68
|
-
type TransitionStartEvent = CS.UnityEngine.UIElements.TransitionStartEvent
|
|
69
|
-
type ValidateCommandEvent = CS.UnityEngine.UIElements.ValidateCommandEvent
|
|
70
|
-
type VectorImage = CS.UnityEngine.UIElements.VectorImage
|
|
71
|
-
type WheelEvent = CS.UnityEngine.UIElements.WheelEvent
|
|
72
|
-
type ContextualMenuPopulateEvent = CS.UnityEngine.UIElements.ContextualMenuPopulateEvent
|
|
73
|
-
|
|
74
|
-
type TwoPaneSplitViewOrientation = CS.UnityEngine.UIElements.TwoPaneSplitViewOrientation
|
|
75
|
-
|
|
76
|
-
declare global {
|
|
77
|
-
export namespace JSX {
|
|
78
|
-
|
|
79
|
-
// export interface IntrinsicElements {
|
|
80
|
-
// [elemName: string]: any; // Allows any element with any props
|
|
81
|
-
// // For specific elements, define more strictly, e.g.,
|
|
82
|
-
// // div: any; // For a div, replace `any` with a more specific type as needed
|
|
83
|
-
// }
|
|
84
|
-
|
|
85
|
-
interface IntrinsicAttributes {
|
|
86
|
-
id?: string
|
|
87
|
-
key?: string | number
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// interface VNode<P = {}> {
|
|
91
|
-
// type: ComponentType<P> | string;
|
|
92
|
-
// props: P & { children: ComponentChildren };
|
|
93
|
-
// key: Key;
|
|
94
|
-
// ref?: Ref<any> | null;
|
|
95
|
-
// startTime?: number;
|
|
96
|
-
// endTime?: number;
|
|
97
|
-
// }
|
|
98
|
-
|
|
99
|
-
// interface Element extends VNode<any> { }
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Base elements
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
interface BaseElement {
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
type RecursiveElement = string | number | object | bigint | boolean | BaseElement | null | undefined | RecursiveElement[]
|
|
110
|
-
|
|
111
|
-
interface CommonEvents {
|
|
112
|
-
onValidateCommand?: (e: ValidateCommandEvent) => void
|
|
113
|
-
onExecuteCommand?: (e: ExecuteCommandEvent) => void
|
|
114
|
-
onDragExited?: (e: DragExitedEvent) => void
|
|
115
|
-
onDragEnter?: (e: DragEnterEvent) => void
|
|
116
|
-
onDragLeave?: (e: DragLeaveEvent) => void
|
|
117
|
-
onDragUpdated?: (e: DragUpdatedEvent) => void
|
|
118
|
-
onDragPerform?: (e: DragPerformEvent) => void
|
|
119
|
-
onFocusOut?: (e: FocusOutEvent) => void
|
|
120
|
-
onBlur?: (e: BlurEvent) => void
|
|
121
|
-
onFocusIn?: (e: FocusInEvent) => void
|
|
122
|
-
onFocus?: (e: FocusEvent) => void
|
|
123
|
-
onInput?: (e: InputEvent) => void
|
|
124
|
-
onKeyDown?: (e: KeyDownEvent) => void
|
|
125
|
-
onKeyUp?: (e: KeyUpEvent) => void
|
|
126
|
-
onGeometryChanged?: (e: GeometryChangedEvent) => void
|
|
127
|
-
onMouseDown?: (e: MouseDownEvent) => void
|
|
128
|
-
onMouseUp?: (e: MouseUpEvent) => void
|
|
129
|
-
onMouseMove?: (e: MouseMoveEvent) => void
|
|
130
|
-
// onContextClick?: (e: ContextClickEvent) => void
|
|
131
|
-
onWheel?: (e: WheelEvent) => void
|
|
132
|
-
onMouseEnter?: (e: MouseEnterEvent) => void
|
|
133
|
-
onMouseLeave?: (e: MouseLeaveEvent) => void
|
|
134
|
-
onMouseEnterWindow?: (e: MouseEnterWindowEvent) => void
|
|
135
|
-
onMouseLeaveWindow?: (e: MouseLeaveWindowEvent) => void
|
|
136
|
-
onMouseOver?: (e: MouseOverEvent) => void
|
|
137
|
-
onMouseOut?: (e: MouseOutEvent) => void
|
|
138
|
-
onContextualMenuPopulate?: (e: ContextualMenuPopulateEvent) => void
|
|
139
|
-
onNavigationMove?: (e: NavigationMoveEvent) => void
|
|
140
|
-
// onNavigationTab?: (e: NavigationTabEvent) => void
|
|
141
|
-
onNavigationCancel?: (e: NavigationCancelEvent) => void
|
|
142
|
-
onNavigationSubmit?: (e: NavigationSubmitEvent) => void
|
|
143
|
-
onAttachToPanel?: (e: AttachToPanelEvent) => void
|
|
144
|
-
onDetachFromPanel?: (e: DetachFromPanelEvent) => void
|
|
145
|
-
onPointerDown?: (e: PointerDownEvent) => void
|
|
146
|
-
onPointerMove?: (e: PointerMoveEvent) => void
|
|
147
|
-
onPointerStationary?: (e: PointerStationaryEvent) => void
|
|
148
|
-
onPointerUp?: (e: PointerUpEvent) => void
|
|
149
|
-
onPointerCancel?: (e: PointerCancelEvent) => void
|
|
150
|
-
onClick?: (e: ClickEvent) => void
|
|
151
|
-
onPointerEnter?: (e: PointerEnterEvent) => void
|
|
152
|
-
onPointerLeave?: (e: PointerLeaveEvent) => void
|
|
153
|
-
onPointerOver?: (e: PointerOverEvent) => void
|
|
154
|
-
onPointerOut?: (e: PointerOutEvent) => void
|
|
155
|
-
onCustomStyleResolved?: (e: CustomStyleResolvedEvent) => void
|
|
156
|
-
onTooltip?: (e: TooltipEvent) => void
|
|
157
|
-
onTransitionRun?: (e: TransitionRunEvent) => void
|
|
158
|
-
onTransitionStart?: (e: TransitionStartEvent) => void
|
|
159
|
-
onTransitionEnd?: (e: TransitionEndEvent) => void
|
|
160
|
-
onTransitionCancel?: (e: TransitionCancelEvent) => void
|
|
161
|
-
// onIMGUI?: (e: IMGUIEvent) => void
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
type AppendCapture<T> = {
|
|
165
|
-
[K in keyof T as `${Extract<K, string>}Capture`]: T[K]
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
type RefObject<T> = { current: T | null }
|
|
169
|
-
type RefCallback<T> = (instance: T | null) => void
|
|
170
|
-
type Ref<T> = RefObject<T> | RefCallback<T>
|
|
171
|
-
|
|
172
|
-
interface VisualElement extends CommonEvents, AppendCapture<CommonEvents> {
|
|
173
|
-
id?: string
|
|
174
|
-
ref?: Ref<any>
|
|
175
|
-
key?: string | number
|
|
176
|
-
disabled?: boolean
|
|
177
|
-
|
|
178
|
-
children?: RecursiveElement
|
|
179
|
-
|
|
180
|
-
dangerouslySetInnerHTML?: {
|
|
181
|
-
__html: string
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
name?: string
|
|
185
|
-
class?: string
|
|
186
|
-
style?: Partial<CS.OneJS.Dom.DomStyle>
|
|
187
|
-
tooltip?: string
|
|
188
|
-
focusable?: boolean
|
|
189
|
-
tabindex?: number
|
|
190
|
-
"usage-hints"?: CS.UnityEngine.UIElements.UsageHints
|
|
191
|
-
"picking-mode"?: PickingMode
|
|
192
|
-
"view-data-key"?: string
|
|
193
|
-
|
|
194
|
-
onPointerCaptureOut?: (e: PointerCaptureOutEvent) => void
|
|
195
|
-
onPointerCapture?: (e: PointerCaptureEvent) => void
|
|
196
|
-
onMouseCaptureOut?: (e: MouseCaptureOutEvent) => void
|
|
197
|
-
onMouseCapture?: (e: MouseCaptureEvent) => void
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
type VisualElementNoChildren = Omit<VisualElement, "children">
|
|
201
|
-
type BindableElementNoChildren = Omit<BindableElement, "children">
|
|
202
|
-
|
|
203
|
-
interface BindableElement extends VisualElement {
|
|
204
|
-
"binding-path"?: string
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Utilities
|
|
209
|
-
*/
|
|
210
|
-
|
|
211
|
-
interface Box extends VisualElement {
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
interface TextElement extends VisualElement {
|
|
216
|
-
text?: string
|
|
217
|
-
"enable-rich-text"?: boolean
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
interface Label extends TextElement {
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
interface Image extends VisualElementNoChildren {
|
|
225
|
-
image?: Texture
|
|
226
|
-
sprite?: Sprite
|
|
227
|
-
"vector-image"?: VectorImage
|
|
228
|
-
"source-rect"?: Rect
|
|
229
|
-
uv?: Rect
|
|
230
|
-
"scale-mode"?: ScaleMode
|
|
231
|
-
"tint-color"?: Color
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
interface IMGUIContainer extends VisualElementNoChildren {
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
interface Foldout extends BindableElement {
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Templates
|
|
244
|
-
*/
|
|
245
|
-
|
|
246
|
-
interface Template extends BindableElementNoChildren {
|
|
247
|
-
name?: string
|
|
248
|
-
path?: string
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
interface Instance extends BindableElementNoChildren {
|
|
252
|
-
template?: string
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
interface TemplateContainer extends BindableElementNoChildren {
|
|
256
|
-
template?: string
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Controls
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
interface BaseField<T> extends BindableElementNoChildren {
|
|
264
|
-
label?: string
|
|
265
|
-
value?: T
|
|
266
|
-
onValueChanged?: (e: ChangeEvent<T>) => void
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
interface BaseBoolField extends BaseField<boolean> {
|
|
270
|
-
text?: string
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
interface Button extends TextElement {
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
interface RadioButton extends BaseBoolField {
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
interface RadioButtonGroup extends BaseField<number> {
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
interface RepeatButton extends TextElement {
|
|
286
|
-
delay?: number
|
|
287
|
-
interval?: number
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
interface Toggle extends BaseBoolField {
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
interface Scroller extends VisualElementNoChildren {
|
|
295
|
-
"low-value"?: number
|
|
296
|
-
"high-value"?: number
|
|
297
|
-
direction?: "Horizontal" | "Vertical"
|
|
298
|
-
value?: number
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
enum SliderDirection {
|
|
302
|
-
Horizontal,
|
|
303
|
-
Vertical
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
interface Slider extends BaseField<number> {
|
|
307
|
-
"low-value"?: number
|
|
308
|
-
"high-value"?: number
|
|
309
|
-
direction?: SliderDirection
|
|
310
|
-
"page-size"?: number
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
interface SliderInt extends BaseField<number> {
|
|
314
|
-
"low-value"?: number
|
|
315
|
-
"high-value"?: number
|
|
316
|
-
direction?: SliderDirection
|
|
317
|
-
"page-size"?: number
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
interface MinMaxSlider extends BaseField<Vector2> {
|
|
321
|
-
"low-limit"?: number
|
|
322
|
-
"high-limit"?: number
|
|
323
|
-
"min-value"?: number
|
|
324
|
-
"max-value"?: number
|
|
325
|
-
value?: Vector2
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
interface EnumField extends BaseField<number> {
|
|
329
|
-
type?: string
|
|
330
|
-
value?: number
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
interface ProgressBar extends BindableElementNoChildren {
|
|
334
|
-
"low-value"?: number
|
|
335
|
-
"high-value"?: number
|
|
336
|
-
value?: number
|
|
337
|
-
title?: string
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Text input
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
interface TextInputBaseField<T> extends BaseField<T> {
|
|
345
|
-
text?: string
|
|
346
|
-
"auto-correction"?: boolean
|
|
347
|
-
"cursor-index"?: number
|
|
348
|
-
"double-click-selects-word"?: boolean
|
|
349
|
-
"triple-click-selects-line"?: boolean
|
|
350
|
-
"emoji-fallback-support"?: boolean
|
|
351
|
-
"hide-mobile-input"?: boolean
|
|
352
|
-
"is-delayed"?: boolean
|
|
353
|
-
"is-password-field"?: boolean
|
|
354
|
-
"is-read-only"?: boolean
|
|
355
|
-
"keyboard-type"?: TouchScreenKeyboardType
|
|
356
|
-
"mask-char"?: string
|
|
357
|
-
"max-length"?: number
|
|
358
|
-
"select-all-on-focus"?: boolean
|
|
359
|
-
"select-all-on-mouse-up"?: boolean
|
|
360
|
-
"select-index"?: number
|
|
361
|
-
"vertical-scroller-visibility"?: ScrollerVisibility
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
interface TextField extends TextInputBaseField<string> {
|
|
365
|
-
multiline?: boolean
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
interface TextValueField<T> extends TextInputBaseField<T> {
|
|
369
|
-
"format-string"?: string
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
interface IntegerField extends TextValueField<number> {
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
interface LongField extends TextValueField<number> {
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
interface FloatField extends TextValueField<number> {
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
interface DoubleField extends TextValueField<number> {
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
interface Vector2Field extends BaseField<Vector2> {
|
|
389
|
-
x?: number
|
|
390
|
-
y?: number
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
interface Vector2IntField extends BaseField<Vector2Int> {
|
|
394
|
-
x?: number
|
|
395
|
-
y?: number
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
interface Vector3Field extends BaseField<Vector3> {
|
|
399
|
-
x?: number
|
|
400
|
-
y?: number
|
|
401
|
-
z?: number
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
interface Vector3IntField extends BaseField<Vector3Int> {
|
|
405
|
-
x?: number
|
|
406
|
-
y?: number
|
|
407
|
-
z?: number
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
interface Vector4Field extends BaseField<Vector4> {
|
|
411
|
-
x?: number
|
|
412
|
-
y?: number
|
|
413
|
-
z?: number
|
|
414
|
-
w?: number
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
interface RectField extends BaseField<Rect> {
|
|
418
|
-
x?: number
|
|
419
|
-
y?: number
|
|
420
|
-
w?: number
|
|
421
|
-
h?: number
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
interface RectIntField extends BaseField<RectInt> {
|
|
425
|
-
x?: number
|
|
426
|
-
y?: number
|
|
427
|
-
w?: number
|
|
428
|
-
h?: number
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
interface BoundsField extends BaseField<Bounds> {
|
|
432
|
-
cx?: number
|
|
433
|
-
cy?: number
|
|
434
|
-
cz?: number
|
|
435
|
-
ex?: number
|
|
436
|
-
ey?: number
|
|
437
|
-
ez?: number
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
interface BoundsIntField extends BaseField<BoundsInt> {
|
|
441
|
-
px?: number
|
|
442
|
-
py?: number
|
|
443
|
-
pz?: number
|
|
444
|
-
sx?: number
|
|
445
|
-
sy?: number
|
|
446
|
-
sz?: number
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
interface ListView extends VisualElementNoChildren {
|
|
450
|
-
"item-height"?: number
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
interface SimpleListView extends ListView {
|
|
454
|
-
make?: () => any
|
|
455
|
-
bind?: (e: any, i: number) => void
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
interface ScrollView extends VisualElement {
|
|
459
|
-
mode?: ScrollViewMode
|
|
460
|
-
"horizontal-scroller-visibility"?: ScrollerVisibility
|
|
461
|
-
"vertical-scroller-visibility"?: ScrollerVisibility
|
|
462
|
-
"horizontal-page-size"?: number
|
|
463
|
-
"vertical-page-size"?: number
|
|
464
|
-
"touch-scroll-behavior"?: TouchScrollBehavior
|
|
465
|
-
"scroll-deceleration-rate"?: number
|
|
466
|
-
"elasticity"?: number
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
interface TreeView extends VisualElement {
|
|
470
|
-
"item-height"?: number
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
interface PopupWindow extends TextElement {
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
interface DropdownField extends BaseField<string> {
|
|
478
|
-
text?: string
|
|
479
|
-
label?: string
|
|
480
|
-
index?: number
|
|
481
|
-
choices?: string[]
|
|
482
|
-
value?: string
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
interface TwoPaneSplitView extends VisualElement {
|
|
486
|
-
"fixed-pane-index"?: number
|
|
487
|
-
"fixed-pane-initial-dimension"?: number
|
|
488
|
-
orientation?: TwoPaneSplitViewOrientation
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* OneJS Elements
|
|
493
|
-
*/
|
|
494
|
-
|
|
495
|
-
interface Img extends Image {
|
|
496
|
-
src?: string
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
interface GradientRect extends VisualElement {
|
|
500
|
-
colors?: Color[]
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
interface Flipbook extends VisualElement {
|
|
504
|
-
src?: string | Texture2D
|
|
505
|
-
count?: number
|
|
506
|
-
interval?: number
|
|
507
|
-
"num-per-row"?: number
|
|
508
|
-
"random-rotation"?: boolean
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* All-in-one
|
|
513
|
-
*/
|
|
514
|
-
|
|
515
|
-
export interface IntrinsicElements {
|
|
516
|
-
div: VisualElement
|
|
517
|
-
box: Box
|
|
518
|
-
textelement: TextElement
|
|
519
|
-
label: Label
|
|
520
|
-
image: Image
|
|
521
|
-
foldout: Foldout
|
|
522
|
-
template: Template
|
|
523
|
-
instance: Instance
|
|
524
|
-
templatecontainer: TemplateContainer
|
|
525
|
-
button: Button
|
|
526
|
-
radiobutton: RadioButton
|
|
527
|
-
radiobuttongroup: RadioButtonGroup
|
|
528
|
-
repeatbutton: RepeatButton
|
|
529
|
-
toggle: Toggle
|
|
530
|
-
scroller: Scroller
|
|
531
|
-
slider: Slider
|
|
532
|
-
sliderint: SliderInt
|
|
533
|
-
minmaxslider: MinMaxSlider
|
|
534
|
-
enumfield: EnumField
|
|
535
|
-
progressbar: ProgressBar
|
|
536
|
-
|
|
537
|
-
textfield: TextField
|
|
538
|
-
integerfield: IntegerField
|
|
539
|
-
floatfield: FloatField
|
|
540
|
-
vector2field: Vector2Field
|
|
541
|
-
vector2intfield: Vector2IntField
|
|
542
|
-
vector3field: Vector3Field
|
|
543
|
-
vector3intfield: Vector3IntField
|
|
544
|
-
vector4field: Vector4Field
|
|
545
|
-
rectfield: RectField
|
|
546
|
-
rectintfield: RectIntField
|
|
547
|
-
boundsfield: BoundsField
|
|
548
|
-
boundsintfield: BoundsIntField
|
|
549
|
-
|
|
550
|
-
listview: ListView
|
|
551
|
-
scrollview: ScrollView
|
|
552
|
-
treeview: TreeView
|
|
553
|
-
popupwindow: PopupWindow
|
|
554
|
-
dropdownfield: DropdownField
|
|
555
|
-
|
|
556
|
-
"twopane-splitview": TwoPaneSplitView
|
|
557
|
-
|
|
558
|
-
// /* OneJS Custom */
|
|
559
|
-
img: Img
|
|
560
|
-
gradientrect: GradientRect
|
|
561
|
-
flipbook: Flipbook
|
|
562
|
-
// simplelistview: SimpleListView
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
export type IntrinsicElements = JSX.IntrinsicElements
|
|
568
|
-
export type CommonEvents = JSX.CommonEvents
|
|
569
|
-
export type VisualElement = JSX.VisualElement
|
|
570
|
-
|
|
1
|
+
type Texture = CS.UnityEngine.Texture
|
|
2
|
+
type Sprite = CS.UnityEngine.Sprite
|
|
3
|
+
type Rect = CS.UnityEngine.Rect
|
|
4
|
+
type Vector2 = CS.UnityEngine.Vector2
|
|
5
|
+
type Vector2Int = CS.UnityEngine.Vector2Int
|
|
6
|
+
type Vector3 = CS.UnityEngine.Vector3
|
|
7
|
+
type Vector3Int = CS.UnityEngine.Vector3Int
|
|
8
|
+
type Vector4 = CS.UnityEngine.Vector4
|
|
9
|
+
type RectInt = CS.UnityEngine.RectInt
|
|
10
|
+
type Bounds = CS.UnityEngine.Bounds
|
|
11
|
+
type BoundsInt = CS.UnityEngine.BoundsInt
|
|
12
|
+
type Texture2D = CS.UnityEngine.Texture2D
|
|
13
|
+
|
|
14
|
+
type TouchScreenKeyboardType = CS.UnityEngine.TouchScreenKeyboardType
|
|
15
|
+
|
|
16
|
+
type AttachToPanelEvent = CS.UnityEngine.UIElements.AttachToPanelEvent
|
|
17
|
+
type BlurEvent = CS.UnityEngine.UIElements.BlurEvent
|
|
18
|
+
type ChangeEvent<T> = CS.UnityEngine.UIElements.ChangeEvent<T>
|
|
19
|
+
type ClickEvent = CS.UnityEngine.UIElements.ClickEvent
|
|
20
|
+
type CustomStyleResolvedEvent = CS.UnityEngine.UIElements.CustomStyleResolvedEvent
|
|
21
|
+
type DetachFromPanelEvent = CS.UnityEngine.UIElements.DetachFromPanelEvent
|
|
22
|
+
type DragEnterEvent = CS.UnityEngine.UIElements.DragEnterEvent
|
|
23
|
+
type DragExitedEvent = CS.UnityEngine.UIElements.DragExitedEvent
|
|
24
|
+
type DragLeaveEvent = CS.UnityEngine.UIElements.DragLeaveEvent
|
|
25
|
+
type DragPerformEvent = CS.UnityEngine.UIElements.DragPerformEvent
|
|
26
|
+
type DragUpdatedEvent = CS.UnityEngine.UIElements.DragUpdatedEvent
|
|
27
|
+
type ExecuteCommandEvent = CS.UnityEngine.UIElements.ExecuteCommandEvent
|
|
28
|
+
type FocusEvent = CS.UnityEngine.UIElements.FocusEvent
|
|
29
|
+
type FocusInEvent = CS.UnityEngine.UIElements.FocusInEvent
|
|
30
|
+
type FocusOutEvent = CS.UnityEngine.UIElements.FocusOutEvent
|
|
31
|
+
type GeometryChangedEvent = CS.UnityEngine.UIElements.GeometryChangedEvent
|
|
32
|
+
type InputEvent = CS.UnityEngine.UIElements.InputEvent
|
|
33
|
+
type KeyDownEvent = CS.UnityEngine.UIElements.KeyDownEvent
|
|
34
|
+
type KeyUpEvent = CS.UnityEngine.UIElements.KeyUpEvent
|
|
35
|
+
type MouseCaptureEvent = CS.UnityEngine.UIElements.MouseCaptureEvent
|
|
36
|
+
type MouseCaptureOutEvent = CS.UnityEngine.UIElements.MouseCaptureOutEvent
|
|
37
|
+
type MouseDownEvent = CS.UnityEngine.UIElements.MouseDownEvent
|
|
38
|
+
type MouseEnterEvent = CS.UnityEngine.UIElements.MouseEnterEvent
|
|
39
|
+
type MouseEnterWindowEvent = CS.UnityEngine.UIElements.MouseEnterWindowEvent
|
|
40
|
+
type MouseLeaveEvent = CS.UnityEngine.UIElements.MouseLeaveEvent
|
|
41
|
+
type MouseLeaveWindowEvent = CS.UnityEngine.UIElements.MouseLeaveWindowEvent
|
|
42
|
+
type MouseMoveEvent = CS.UnityEngine.UIElements.MouseMoveEvent
|
|
43
|
+
type MouseOutEvent = CS.UnityEngine.UIElements.MouseOutEvent
|
|
44
|
+
type MouseOverEvent = CS.UnityEngine.UIElements.MouseOverEvent
|
|
45
|
+
type MouseUpEvent = CS.UnityEngine.UIElements.MouseUpEvent
|
|
46
|
+
type NavigationCancelEvent = CS.UnityEngine.UIElements.NavigationCancelEvent
|
|
47
|
+
type NavigationMoveEvent = CS.UnityEngine.UIElements.NavigationMoveEvent
|
|
48
|
+
type NavigationSubmitEvent = CS.UnityEngine.UIElements.NavigationSubmitEvent
|
|
49
|
+
type PickingMode = CS.UnityEngine.UIElements.PickingMode
|
|
50
|
+
type PointerCancelEvent = CS.UnityEngine.UIElements.PointerCancelEvent
|
|
51
|
+
type PointerCaptureEvent = CS.UnityEngine.UIElements.PointerCaptureEvent
|
|
52
|
+
type PointerCaptureOutEvent = CS.UnityEngine.UIElements.PointerCaptureOutEvent
|
|
53
|
+
type PointerDownEvent = CS.UnityEngine.UIElements.PointerDownEvent
|
|
54
|
+
type PointerEnterEvent = CS.UnityEngine.UIElements.PointerEnterEvent
|
|
55
|
+
type PointerLeaveEvent = CS.UnityEngine.UIElements.PointerLeaveEvent
|
|
56
|
+
type PointerMoveEvent = CS.UnityEngine.UIElements.PointerMoveEvent
|
|
57
|
+
type PointerOutEvent = CS.UnityEngine.UIElements.PointerOutEvent
|
|
58
|
+
type PointerOverEvent = CS.UnityEngine.UIElements.PointerOverEvent
|
|
59
|
+
type PointerStationaryEvent = CS.UnityEngine.UIElements.PointerStationaryEvent
|
|
60
|
+
type PointerUpEvent = CS.UnityEngine.UIElements.PointerUpEvent
|
|
61
|
+
type ScrollViewMode = CS.UnityEngine.UIElements.ScrollViewMode
|
|
62
|
+
type ScrollerVisibility = CS.UnityEngine.UIElements.ScrollerVisibility
|
|
63
|
+
type TouchScrollBehavior = CS.UnityEngine.UIElements.ScrollView.TouchScrollBehavior
|
|
64
|
+
type TooltipEvent = CS.UnityEngine.UIElements.TooltipEvent
|
|
65
|
+
type TransitionCancelEvent = CS.UnityEngine.UIElements.TransitionCancelEvent
|
|
66
|
+
type TransitionEndEvent = CS.UnityEngine.UIElements.TransitionEndEvent
|
|
67
|
+
type TransitionRunEvent = CS.UnityEngine.UIElements.TransitionRunEvent
|
|
68
|
+
type TransitionStartEvent = CS.UnityEngine.UIElements.TransitionStartEvent
|
|
69
|
+
type ValidateCommandEvent = CS.UnityEngine.UIElements.ValidateCommandEvent
|
|
70
|
+
type VectorImage = CS.UnityEngine.UIElements.VectorImage
|
|
71
|
+
type WheelEvent = CS.UnityEngine.UIElements.WheelEvent
|
|
72
|
+
type ContextualMenuPopulateEvent = CS.UnityEngine.UIElements.ContextualMenuPopulateEvent
|
|
73
|
+
|
|
74
|
+
type TwoPaneSplitViewOrientation = CS.UnityEngine.UIElements.TwoPaneSplitViewOrientation
|
|
75
|
+
|
|
76
|
+
declare global {
|
|
77
|
+
export namespace JSX {
|
|
78
|
+
|
|
79
|
+
// export interface IntrinsicElements {
|
|
80
|
+
// [elemName: string]: any; // Allows any element with any props
|
|
81
|
+
// // For specific elements, define more strictly, e.g.,
|
|
82
|
+
// // div: any; // For a div, replace `any` with a more specific type as needed
|
|
83
|
+
// }
|
|
84
|
+
|
|
85
|
+
interface IntrinsicAttributes {
|
|
86
|
+
id?: string
|
|
87
|
+
key?: string | number
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// interface VNode<P = {}> {
|
|
91
|
+
// type: ComponentType<P> | string;
|
|
92
|
+
// props: P & { children: ComponentChildren };
|
|
93
|
+
// key: Key;
|
|
94
|
+
// ref?: Ref<any> | null;
|
|
95
|
+
// startTime?: number;
|
|
96
|
+
// endTime?: number;
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
// interface Element extends VNode<any> { }
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Base elements
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
interface BaseElement {
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
type RecursiveElement = string | number | object | bigint | boolean | BaseElement | null | undefined | RecursiveElement[]
|
|
110
|
+
|
|
111
|
+
interface CommonEvents {
|
|
112
|
+
onValidateCommand?: (e: ValidateCommandEvent) => void
|
|
113
|
+
onExecuteCommand?: (e: ExecuteCommandEvent) => void
|
|
114
|
+
onDragExited?: (e: DragExitedEvent) => void
|
|
115
|
+
onDragEnter?: (e: DragEnterEvent) => void
|
|
116
|
+
onDragLeave?: (e: DragLeaveEvent) => void
|
|
117
|
+
onDragUpdated?: (e: DragUpdatedEvent) => void
|
|
118
|
+
onDragPerform?: (e: DragPerformEvent) => void
|
|
119
|
+
onFocusOut?: (e: FocusOutEvent) => void
|
|
120
|
+
onBlur?: (e: BlurEvent) => void
|
|
121
|
+
onFocusIn?: (e: FocusInEvent) => void
|
|
122
|
+
onFocus?: (e: FocusEvent) => void
|
|
123
|
+
onInput?: (e: InputEvent) => void
|
|
124
|
+
onKeyDown?: (e: KeyDownEvent) => void
|
|
125
|
+
onKeyUp?: (e: KeyUpEvent) => void
|
|
126
|
+
onGeometryChanged?: (e: GeometryChangedEvent) => void
|
|
127
|
+
onMouseDown?: (e: MouseDownEvent) => void
|
|
128
|
+
onMouseUp?: (e: MouseUpEvent) => void
|
|
129
|
+
onMouseMove?: (e: MouseMoveEvent) => void
|
|
130
|
+
// onContextClick?: (e: ContextClickEvent) => void
|
|
131
|
+
onWheel?: (e: WheelEvent) => void
|
|
132
|
+
onMouseEnter?: (e: MouseEnterEvent) => void
|
|
133
|
+
onMouseLeave?: (e: MouseLeaveEvent) => void
|
|
134
|
+
onMouseEnterWindow?: (e: MouseEnterWindowEvent) => void
|
|
135
|
+
onMouseLeaveWindow?: (e: MouseLeaveWindowEvent) => void
|
|
136
|
+
onMouseOver?: (e: MouseOverEvent) => void
|
|
137
|
+
onMouseOut?: (e: MouseOutEvent) => void
|
|
138
|
+
onContextualMenuPopulate?: (e: ContextualMenuPopulateEvent) => void
|
|
139
|
+
onNavigationMove?: (e: NavigationMoveEvent) => void
|
|
140
|
+
// onNavigationTab?: (e: NavigationTabEvent) => void
|
|
141
|
+
onNavigationCancel?: (e: NavigationCancelEvent) => void
|
|
142
|
+
onNavigationSubmit?: (e: NavigationSubmitEvent) => void
|
|
143
|
+
onAttachToPanel?: (e: AttachToPanelEvent) => void
|
|
144
|
+
onDetachFromPanel?: (e: DetachFromPanelEvent) => void
|
|
145
|
+
onPointerDown?: (e: PointerDownEvent) => void
|
|
146
|
+
onPointerMove?: (e: PointerMoveEvent) => void
|
|
147
|
+
onPointerStationary?: (e: PointerStationaryEvent) => void
|
|
148
|
+
onPointerUp?: (e: PointerUpEvent) => void
|
|
149
|
+
onPointerCancel?: (e: PointerCancelEvent) => void
|
|
150
|
+
onClick?: (e: ClickEvent) => void
|
|
151
|
+
onPointerEnter?: (e: PointerEnterEvent) => void
|
|
152
|
+
onPointerLeave?: (e: PointerLeaveEvent) => void
|
|
153
|
+
onPointerOver?: (e: PointerOverEvent) => void
|
|
154
|
+
onPointerOut?: (e: PointerOutEvent) => void
|
|
155
|
+
onCustomStyleResolved?: (e: CustomStyleResolvedEvent) => void
|
|
156
|
+
onTooltip?: (e: TooltipEvent) => void
|
|
157
|
+
onTransitionRun?: (e: TransitionRunEvent) => void
|
|
158
|
+
onTransitionStart?: (e: TransitionStartEvent) => void
|
|
159
|
+
onTransitionEnd?: (e: TransitionEndEvent) => void
|
|
160
|
+
onTransitionCancel?: (e: TransitionCancelEvent) => void
|
|
161
|
+
// onIMGUI?: (e: IMGUIEvent) => void
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
type AppendCapture<T> = {
|
|
165
|
+
[K in keyof T as `${Extract<K, string>}Capture`]: T[K]
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type RefObject<T> = { current: T | null }
|
|
169
|
+
type RefCallback<T> = (instance: T | null) => void
|
|
170
|
+
type Ref<T> = RefObject<T> | RefCallback<T>
|
|
171
|
+
|
|
172
|
+
interface VisualElement extends CommonEvents, AppendCapture<CommonEvents> {
|
|
173
|
+
id?: string
|
|
174
|
+
ref?: Ref<any>
|
|
175
|
+
key?: string | number
|
|
176
|
+
disabled?: boolean
|
|
177
|
+
|
|
178
|
+
children?: RecursiveElement
|
|
179
|
+
|
|
180
|
+
dangerouslySetInnerHTML?: {
|
|
181
|
+
__html: string
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
name?: string
|
|
185
|
+
class?: string
|
|
186
|
+
style?: Partial<CS.OneJS.Dom.DomStyle>
|
|
187
|
+
tooltip?: string
|
|
188
|
+
focusable?: boolean
|
|
189
|
+
tabindex?: number
|
|
190
|
+
"usage-hints"?: CS.UnityEngine.UIElements.UsageHints
|
|
191
|
+
"picking-mode"?: PickingMode
|
|
192
|
+
"view-data-key"?: string
|
|
193
|
+
|
|
194
|
+
onPointerCaptureOut?: (e: PointerCaptureOutEvent) => void
|
|
195
|
+
onPointerCapture?: (e: PointerCaptureEvent) => void
|
|
196
|
+
onMouseCaptureOut?: (e: MouseCaptureOutEvent) => void
|
|
197
|
+
onMouseCapture?: (e: MouseCaptureEvent) => void
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
type VisualElementNoChildren = Omit<VisualElement, "children">
|
|
201
|
+
type BindableElementNoChildren = Omit<BindableElement, "children">
|
|
202
|
+
|
|
203
|
+
interface BindableElement extends VisualElement {
|
|
204
|
+
"binding-path"?: string
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Utilities
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
interface Box extends VisualElement {
|
|
212
|
+
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface TextElement extends VisualElement {
|
|
216
|
+
text?: string
|
|
217
|
+
"enable-rich-text"?: boolean
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface Label extends TextElement {
|
|
221
|
+
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface Image extends VisualElementNoChildren {
|
|
225
|
+
image?: Texture
|
|
226
|
+
sprite?: Sprite
|
|
227
|
+
"vector-image"?: VectorImage
|
|
228
|
+
"source-rect"?: Rect
|
|
229
|
+
uv?: Rect
|
|
230
|
+
"scale-mode"?: ScaleMode
|
|
231
|
+
"tint-color"?: Color
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface IMGUIContainer extends VisualElementNoChildren {
|
|
235
|
+
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface Foldout extends BindableElement {
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Templates
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
interface Template extends BindableElementNoChildren {
|
|
247
|
+
name?: string
|
|
248
|
+
path?: string
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
interface Instance extends BindableElementNoChildren {
|
|
252
|
+
template?: string
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface TemplateContainer extends BindableElementNoChildren {
|
|
256
|
+
template?: string
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Controls
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
interface BaseField<T> extends BindableElementNoChildren {
|
|
264
|
+
label?: string
|
|
265
|
+
value?: T
|
|
266
|
+
onValueChanged?: (e: ChangeEvent<T>) => void
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface BaseBoolField extends BaseField<boolean> {
|
|
270
|
+
text?: string
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
interface Button extends TextElement {
|
|
274
|
+
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
interface RadioButton extends BaseBoolField {
|
|
278
|
+
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
interface RadioButtonGroup extends BaseField<number> {
|
|
282
|
+
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface RepeatButton extends TextElement {
|
|
286
|
+
delay?: number
|
|
287
|
+
interval?: number
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
interface Toggle extends BaseBoolField {
|
|
291
|
+
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
interface Scroller extends VisualElementNoChildren {
|
|
295
|
+
"low-value"?: number
|
|
296
|
+
"high-value"?: number
|
|
297
|
+
direction?: "Horizontal" | "Vertical"
|
|
298
|
+
value?: number
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
enum SliderDirection {
|
|
302
|
+
Horizontal,
|
|
303
|
+
Vertical
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface Slider extends BaseField<number> {
|
|
307
|
+
"low-value"?: number
|
|
308
|
+
"high-value"?: number
|
|
309
|
+
direction?: SliderDirection
|
|
310
|
+
"page-size"?: number
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface SliderInt extends BaseField<number> {
|
|
314
|
+
"low-value"?: number
|
|
315
|
+
"high-value"?: number
|
|
316
|
+
direction?: SliderDirection
|
|
317
|
+
"page-size"?: number
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
interface MinMaxSlider extends BaseField<Vector2> {
|
|
321
|
+
"low-limit"?: number
|
|
322
|
+
"high-limit"?: number
|
|
323
|
+
"min-value"?: number
|
|
324
|
+
"max-value"?: number
|
|
325
|
+
value?: Vector2
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface EnumField extends BaseField<number> {
|
|
329
|
+
type?: string
|
|
330
|
+
value?: number
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface ProgressBar extends BindableElementNoChildren {
|
|
334
|
+
"low-value"?: number
|
|
335
|
+
"high-value"?: number
|
|
336
|
+
value?: number
|
|
337
|
+
title?: string
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Text input
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
interface TextInputBaseField<T> extends BaseField<T> {
|
|
345
|
+
text?: string
|
|
346
|
+
"auto-correction"?: boolean
|
|
347
|
+
"cursor-index"?: number
|
|
348
|
+
"double-click-selects-word"?: boolean
|
|
349
|
+
"triple-click-selects-line"?: boolean
|
|
350
|
+
"emoji-fallback-support"?: boolean
|
|
351
|
+
"hide-mobile-input"?: boolean
|
|
352
|
+
"is-delayed"?: boolean
|
|
353
|
+
"is-password-field"?: boolean
|
|
354
|
+
"is-read-only"?: boolean
|
|
355
|
+
"keyboard-type"?: TouchScreenKeyboardType
|
|
356
|
+
"mask-char"?: string
|
|
357
|
+
"max-length"?: number
|
|
358
|
+
"select-all-on-focus"?: boolean
|
|
359
|
+
"select-all-on-mouse-up"?: boolean
|
|
360
|
+
"select-index"?: number
|
|
361
|
+
"vertical-scroller-visibility"?: ScrollerVisibility
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
interface TextField extends TextInputBaseField<string> {
|
|
365
|
+
multiline?: boolean
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface TextValueField<T> extends TextInputBaseField<T> {
|
|
369
|
+
"format-string"?: string
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
interface IntegerField extends TextValueField<number> {
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
interface LongField extends TextValueField<number> {
|
|
377
|
+
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
interface FloatField extends TextValueField<number> {
|
|
381
|
+
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
interface DoubleField extends TextValueField<number> {
|
|
385
|
+
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
interface Vector2Field extends BaseField<Vector2> {
|
|
389
|
+
x?: number
|
|
390
|
+
y?: number
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
interface Vector2IntField extends BaseField<Vector2Int> {
|
|
394
|
+
x?: number
|
|
395
|
+
y?: number
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
interface Vector3Field extends BaseField<Vector3> {
|
|
399
|
+
x?: number
|
|
400
|
+
y?: number
|
|
401
|
+
z?: number
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
interface Vector3IntField extends BaseField<Vector3Int> {
|
|
405
|
+
x?: number
|
|
406
|
+
y?: number
|
|
407
|
+
z?: number
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface Vector4Field extends BaseField<Vector4> {
|
|
411
|
+
x?: number
|
|
412
|
+
y?: number
|
|
413
|
+
z?: number
|
|
414
|
+
w?: number
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface RectField extends BaseField<Rect> {
|
|
418
|
+
x?: number
|
|
419
|
+
y?: number
|
|
420
|
+
w?: number
|
|
421
|
+
h?: number
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
interface RectIntField extends BaseField<RectInt> {
|
|
425
|
+
x?: number
|
|
426
|
+
y?: number
|
|
427
|
+
w?: number
|
|
428
|
+
h?: number
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
interface BoundsField extends BaseField<Bounds> {
|
|
432
|
+
cx?: number
|
|
433
|
+
cy?: number
|
|
434
|
+
cz?: number
|
|
435
|
+
ex?: number
|
|
436
|
+
ey?: number
|
|
437
|
+
ez?: number
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface BoundsIntField extends BaseField<BoundsInt> {
|
|
441
|
+
px?: number
|
|
442
|
+
py?: number
|
|
443
|
+
pz?: number
|
|
444
|
+
sx?: number
|
|
445
|
+
sy?: number
|
|
446
|
+
sz?: number
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
interface ListView extends VisualElementNoChildren {
|
|
450
|
+
"item-height"?: number
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
interface SimpleListView extends ListView {
|
|
454
|
+
make?: () => any
|
|
455
|
+
bind?: (e: any, i: number) => void
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface ScrollView extends VisualElement {
|
|
459
|
+
mode?: ScrollViewMode
|
|
460
|
+
"horizontal-scroller-visibility"?: ScrollerVisibility
|
|
461
|
+
"vertical-scroller-visibility"?: ScrollerVisibility
|
|
462
|
+
"horizontal-page-size"?: number
|
|
463
|
+
"vertical-page-size"?: number
|
|
464
|
+
"touch-scroll-behavior"?: TouchScrollBehavior
|
|
465
|
+
"scroll-deceleration-rate"?: number
|
|
466
|
+
"elasticity"?: number
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface TreeView extends VisualElement {
|
|
470
|
+
"item-height"?: number
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
interface PopupWindow extends TextElement {
|
|
474
|
+
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface DropdownField extends BaseField<string> {
|
|
478
|
+
text?: string
|
|
479
|
+
label?: string
|
|
480
|
+
index?: number
|
|
481
|
+
choices?: string[]
|
|
482
|
+
value?: string
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
interface TwoPaneSplitView extends VisualElement {
|
|
486
|
+
"fixed-pane-index"?: number
|
|
487
|
+
"fixed-pane-initial-dimension"?: number
|
|
488
|
+
orientation?: TwoPaneSplitViewOrientation
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* OneJS Elements
|
|
493
|
+
*/
|
|
494
|
+
|
|
495
|
+
interface Img extends Image {
|
|
496
|
+
src?: string
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
interface GradientRect extends VisualElement {
|
|
500
|
+
colors?: Color[]
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
interface Flipbook extends VisualElement {
|
|
504
|
+
src?: string | Texture2D
|
|
505
|
+
count?: number
|
|
506
|
+
interval?: number
|
|
507
|
+
"num-per-row"?: number
|
|
508
|
+
"random-rotation"?: boolean
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* All-in-one
|
|
513
|
+
*/
|
|
514
|
+
|
|
515
|
+
export interface IntrinsicElements {
|
|
516
|
+
div: VisualElement
|
|
517
|
+
box: Box
|
|
518
|
+
textelement: TextElement
|
|
519
|
+
label: Label
|
|
520
|
+
image: Image
|
|
521
|
+
foldout: Foldout
|
|
522
|
+
template: Template
|
|
523
|
+
instance: Instance
|
|
524
|
+
templatecontainer: TemplateContainer
|
|
525
|
+
button: Button
|
|
526
|
+
radiobutton: RadioButton
|
|
527
|
+
radiobuttongroup: RadioButtonGroup
|
|
528
|
+
repeatbutton: RepeatButton
|
|
529
|
+
toggle: Toggle
|
|
530
|
+
scroller: Scroller
|
|
531
|
+
slider: Slider
|
|
532
|
+
sliderint: SliderInt
|
|
533
|
+
minmaxslider: MinMaxSlider
|
|
534
|
+
enumfield: EnumField
|
|
535
|
+
progressbar: ProgressBar
|
|
536
|
+
|
|
537
|
+
textfield: TextField
|
|
538
|
+
integerfield: IntegerField
|
|
539
|
+
floatfield: FloatField
|
|
540
|
+
vector2field: Vector2Field
|
|
541
|
+
vector2intfield: Vector2IntField
|
|
542
|
+
vector3field: Vector3Field
|
|
543
|
+
vector3intfield: Vector3IntField
|
|
544
|
+
vector4field: Vector4Field
|
|
545
|
+
rectfield: RectField
|
|
546
|
+
rectintfield: RectIntField
|
|
547
|
+
boundsfield: BoundsField
|
|
548
|
+
boundsintfield: BoundsIntField
|
|
549
|
+
|
|
550
|
+
listview: ListView
|
|
551
|
+
scrollview: ScrollView
|
|
552
|
+
treeview: TreeView
|
|
553
|
+
popupwindow: PopupWindow
|
|
554
|
+
dropdownfield: DropdownField
|
|
555
|
+
|
|
556
|
+
"twopane-splitview": TwoPaneSplitView
|
|
557
|
+
|
|
558
|
+
// /* OneJS Custom */
|
|
559
|
+
img: Img
|
|
560
|
+
gradientrect: GradientRect
|
|
561
|
+
flipbook: Flipbook
|
|
562
|
+
// simplelistview: SimpleListView
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export type IntrinsicElements = JSX.IntrinsicElements
|
|
568
|
+
export type CommonEvents = JSX.CommonEvents
|
|
569
|
+
export type VisualElement = JSX.VisualElement
|
|
570
|
+
|
|
571
571
|
export { }
|