@killscript/types 0.1.0
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/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/client.d.ts +15 -0
- package/dist/generated/client.d.ts +457 -0
- package/dist/generated/server.d.ts +14 -0
- package/dist/generated/shared.d.ts +755 -0
- package/dist/server.d.ts +3 -0
- package/dist/shared.d.ts +152 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KILLSCRIPT contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @killscript/types
|
|
2
|
+
|
|
3
|
+
TypeScript declarations for the verified native KILLSCRIPT Lua API. Client and
|
|
4
|
+
Reflex declarations are available through `@killscript/types/client` and
|
|
5
|
+
`@killscript/types/server`.
|
|
6
|
+
|
|
7
|
+
The declarations cover the complete public `LuaType`/`LuaGen` surface exposed
|
|
8
|
+
by the current game source metadata. Context-specific globals, mutability,
|
|
9
|
+
optional objects, native one-based arrays and verified runtime caveats are
|
|
10
|
+
represented directly in TypeScript.
|
|
11
|
+
|
|
12
|
+
Generated projects load the right declaration entry automatically. For manual
|
|
13
|
+
configuration, add one entry to `compilerOptions.types`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{ "compilerOptions": { "types": ["@killscript/types/client"] } }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Behavioral documentation and examples live in the
|
|
20
|
+
[verified native API reference](https://silentbless.github.io/killscript-docs/).
|
|
21
|
+
Licensed under MIT.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./shared.js";
|
|
2
|
+
import "./generated/client.js";
|
|
3
|
+
export {};
|
|
4
|
+
declare global {
|
|
5
|
+
/** Client-only persistent storage. Values are saved when the module unloads. */
|
|
6
|
+
const Storage: StorageTable;
|
|
7
|
+
interface InputAction {
|
|
8
|
+
/**
|
|
9
|
+
* Disables IsPressed(), but the current game build can still invoke
|
|
10
|
+
* OnPerformed callbacks. Guard the callback with your own enabled flag when
|
|
11
|
+
* complete suppression is required.
|
|
12
|
+
*/
|
|
13
|
+
Disable(): void;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import "./shared.js";
|
|
2
|
+
export {};
|
|
3
|
+
declare global {
|
|
4
|
+
interface AgentsApi {
|
|
5
|
+
OnDeath(callback: (event: DeathEvent) => void): EventSubscription;
|
|
6
|
+
OnLocalPlayerDealtDamage(callback: (event: HitEvent) => void): EventSubscription;
|
|
7
|
+
OnLocalPlayerReceivedDamage(callback: (event: DamageEvent) => void): EventSubscription;
|
|
8
|
+
}
|
|
9
|
+
interface Agent {
|
|
10
|
+
readonly Avatar: Texture;
|
|
11
|
+
readonly AvatarIsTeamPlaceholder: boolean;
|
|
12
|
+
readonly IsSpectated: boolean;
|
|
13
|
+
TrySpectate(): boolean;
|
|
14
|
+
}
|
|
15
|
+
interface Aim {
|
|
16
|
+
readonly DirectionViewportPoint: Vector3;
|
|
17
|
+
}
|
|
18
|
+
interface OcclusionCulling {
|
|
19
|
+
readonly HasBeenVisible: boolean;
|
|
20
|
+
readonly TicksSinceLastVisible: number;
|
|
21
|
+
}
|
|
22
|
+
interface SoundsApi {
|
|
23
|
+
GetSound(soundName: string): Sound | undefined;
|
|
24
|
+
PlaySound(sound: Sound, position: Vector3, volume?: number, minDistance?: number, maxDistance?: number, pitch?: number): void;
|
|
25
|
+
PlaySound2D(sound: Sound, volume?: number, pitch?: number): void;
|
|
26
|
+
}
|
|
27
|
+
type Sounds = SoundsApi;
|
|
28
|
+
const Sounds: SoundsApi;
|
|
29
|
+
interface VoiceChatApi {
|
|
30
|
+
IsAvailable(agent: Agent): boolean;
|
|
31
|
+
IsMuted(agent: Agent): boolean;
|
|
32
|
+
IsSpeaking(agent: Agent): boolean;
|
|
33
|
+
SetMuted(agent: Agent, muted: boolean): boolean;
|
|
34
|
+
ToggleMuted(agent: Agent): boolean;
|
|
35
|
+
}
|
|
36
|
+
type VoiceChat = VoiceChatApi;
|
|
37
|
+
const VoiceChat: VoiceChatApi;
|
|
38
|
+
interface VoiceLinePlayerApi {
|
|
39
|
+
readonly IsPlaying: boolean;
|
|
40
|
+
readonly Subtitle: string;
|
|
41
|
+
}
|
|
42
|
+
type VoiceLinePlayer = VoiceLinePlayerApi;
|
|
43
|
+
const VoiceLinePlayer: VoiceLinePlayerApi;
|
|
44
|
+
interface CamerasApi {
|
|
45
|
+
readonly Main: Camera;
|
|
46
|
+
CreateCamera(): Camera | undefined;
|
|
47
|
+
RemoveCamera(camera: Camera): void;
|
|
48
|
+
}
|
|
49
|
+
type Cameras = CamerasApi;
|
|
50
|
+
const Cameras: CamerasApi;
|
|
51
|
+
interface Camera {
|
|
52
|
+
Aspect: number;
|
|
53
|
+
FarClipPlane: number;
|
|
54
|
+
Fov: number;
|
|
55
|
+
readonly IsMainCamera: boolean;
|
|
56
|
+
IsOrthographic: boolean;
|
|
57
|
+
NearClipPlane: number;
|
|
58
|
+
OrthographicSize: number;
|
|
59
|
+
readonly OutputTexture: Texture | undefined;
|
|
60
|
+
Position: Vector3;
|
|
61
|
+
Rotation: Quaternion;
|
|
62
|
+
SetActive(value: boolean): void;
|
|
63
|
+
SetRenderSize(width: number, height: number): void;
|
|
64
|
+
WorldToViewportPoint(worldPos: Vector3): Vector3;
|
|
65
|
+
}
|
|
66
|
+
type ChatChannelKind = 0 | 1 | 2 | 3 | 4;
|
|
67
|
+
const ChatChannelKind: {
|
|
68
|
+
readonly Party: 0;
|
|
69
|
+
readonly Private: 1;
|
|
70
|
+
readonly Match: 2;
|
|
71
|
+
readonly Team: 3;
|
|
72
|
+
readonly System: 4;
|
|
73
|
+
};
|
|
74
|
+
interface ChatManagerApi {
|
|
75
|
+
readonly MessageLimit: number;
|
|
76
|
+
AddLocalMessage(text: string): void;
|
|
77
|
+
GetActiveChannel(): ChatChannel | undefined;
|
|
78
|
+
GetChannels(): LuaArray<ChatChannel>;
|
|
79
|
+
GetMessages(): LuaArray<ChatMessage>;
|
|
80
|
+
OnActiveChannelChanged(callback: () => void): EventSubscription;
|
|
81
|
+
OnChannelsChanged(callback: () => void): EventSubscription;
|
|
82
|
+
OnMessagesChanged(callback: () => void): EventSubscription;
|
|
83
|
+
SendActiveMessage(text: string): boolean;
|
|
84
|
+
SendMessage(text: string): void;
|
|
85
|
+
SetActiveChannel(channelId: string): boolean;
|
|
86
|
+
SetActiveChannelByKind(channelKind: ChatChannelKind): void;
|
|
87
|
+
SetActiveLocalTeamChannel(): void;
|
|
88
|
+
ShowMessageContextMenu(messageId: string): void;
|
|
89
|
+
}
|
|
90
|
+
type ChatManager = ChatManagerApi;
|
|
91
|
+
const ChatManager: ChatManagerApi;
|
|
92
|
+
interface ChatChannel {
|
|
93
|
+
readonly DisplayName: string;
|
|
94
|
+
readonly Id: string;
|
|
95
|
+
readonly IsAvailable: boolean;
|
|
96
|
+
readonly IsReadOnly: boolean;
|
|
97
|
+
readonly Kind: ChatChannelKind;
|
|
98
|
+
readonly KindName: string;
|
|
99
|
+
readonly Team: Team;
|
|
100
|
+
}
|
|
101
|
+
interface ChatMessage {
|
|
102
|
+
readonly ChannelDisplayName: string;
|
|
103
|
+
readonly ChannelId: string;
|
|
104
|
+
readonly ChannelKind: ChatChannelKind;
|
|
105
|
+
readonly IsLocal: boolean;
|
|
106
|
+
readonly IsSystem: boolean;
|
|
107
|
+
readonly MessageId: string;
|
|
108
|
+
readonly SenderDisplayName: string;
|
|
109
|
+
readonly SenderUserId: string;
|
|
110
|
+
readonly Team: Team;
|
|
111
|
+
readonly Text: string;
|
|
112
|
+
}
|
|
113
|
+
interface CombatLogApi {
|
|
114
|
+
readonly Entries: LuaArray<CombatLogEntry>;
|
|
115
|
+
}
|
|
116
|
+
type CombatLog = CombatLogApi;
|
|
117
|
+
const CombatLog: CombatLogApi;
|
|
118
|
+
interface CombatLogEntry {
|
|
119
|
+
readonly BodyPart: EHitboxBodyPart;
|
|
120
|
+
readonly Damage: number;
|
|
121
|
+
readonly Distance: number;
|
|
122
|
+
readonly Instigator: Agent;
|
|
123
|
+
readonly IsFatal: boolean;
|
|
124
|
+
readonly IsOutgoing: boolean;
|
|
125
|
+
readonly ItemId: number;
|
|
126
|
+
readonly Tick: number;
|
|
127
|
+
readonly Victim: Agent;
|
|
128
|
+
readonly WasShieldDestroyed: boolean;
|
|
129
|
+
readonly WasStunned: boolean;
|
|
130
|
+
}
|
|
131
|
+
interface DefusalGameApi {
|
|
132
|
+
readonly IsVictory: boolean;
|
|
133
|
+
}
|
|
134
|
+
interface Entity {
|
|
135
|
+
readonly TicksSinceLastVisible: number;
|
|
136
|
+
}
|
|
137
|
+
interface ThrownProjectile {
|
|
138
|
+
SimulateTrajectory(): LuaArray<Vector3>;
|
|
139
|
+
}
|
|
140
|
+
interface NetworkInfoApi {
|
|
141
|
+
readonly InKBps: number;
|
|
142
|
+
readonly InPacketLossPercent: number;
|
|
143
|
+
readonly InterpolationDelayMs: number;
|
|
144
|
+
readonly OutKBps: number;
|
|
145
|
+
readonly OutPacketLossPercent: number;
|
|
146
|
+
readonly Ping: number;
|
|
147
|
+
readonly RttSeconds: number;
|
|
148
|
+
readonly ServerTickTimeMs: number;
|
|
149
|
+
readonly TickTimeMs: number;
|
|
150
|
+
}
|
|
151
|
+
type NetworkInfo = NetworkInfoApi;
|
|
152
|
+
const NetworkInfo: NetworkInfoApi;
|
|
153
|
+
interface PerformanceApi {
|
|
154
|
+
readonly AvgFps: number;
|
|
155
|
+
readonly CpuUsagePercent: number;
|
|
156
|
+
readonly GpuUsagePercent: number;
|
|
157
|
+
readonly MaxFrameMs: number;
|
|
158
|
+
}
|
|
159
|
+
type Performance = PerformanceApi;
|
|
160
|
+
const Performance: PerformanceApi;
|
|
161
|
+
interface ScreenApi {
|
|
162
|
+
readonly Height: number;
|
|
163
|
+
readonly Width: number;
|
|
164
|
+
}
|
|
165
|
+
type Screen = ScreenApi;
|
|
166
|
+
const Screen: ScreenApi;
|
|
167
|
+
/** @noSelf */
|
|
168
|
+
interface WeaponPreviewApi {
|
|
169
|
+
GetWeaponPreview(weaponName: string): Texture | undefined;
|
|
170
|
+
RemoveFromCache(weaponName: string): void;
|
|
171
|
+
}
|
|
172
|
+
type WeaponPreview = WeaponPreviewApi;
|
|
173
|
+
const WeaponPreview: WeaponPreviewApi;
|
|
174
|
+
interface ImGuiApi {
|
|
175
|
+
AddImGuiWindow(id: string, title: string, rect: Rect): ImGuiWindow;
|
|
176
|
+
DrawDebugText(text: string): void;
|
|
177
|
+
DrawText(text: string, rect: Rect, fontSize?: number, color?: Color | undefined, alignment?: TextAnchor): void;
|
|
178
|
+
DrawTextPos(text: string, screenPosition: Vector2, fontSize?: number, color?: Color | undefined, alignment?: TextAnchor): void;
|
|
179
|
+
DrawTexture(texture: Texture, rect?: Rect | undefined): void;
|
|
180
|
+
DrawTextureColor(texture: Texture, color: Color, rect?: Rect | undefined): void;
|
|
181
|
+
DrawTextUV(text: string, viewportPosition: Vector2, fontSize?: number, color?: Color | undefined, alignment?: TextAnchor): void;
|
|
182
|
+
}
|
|
183
|
+
type ImGui = ImGuiApi;
|
|
184
|
+
const ImGui: ImGuiApi;
|
|
185
|
+
interface ImGuiWindow {
|
|
186
|
+
DrawText(text: string, rect: Rect, fontSize: number, color: Color, alignment?: TextAnchor): void;
|
|
187
|
+
DrawTexture(texture: Texture, rect?: Rect | undefined): void;
|
|
188
|
+
DrawTextureColor(texture: Texture, color: Color, rect?: Rect | undefined): void;
|
|
189
|
+
GetContentRenderSize(): Vector2;
|
|
190
|
+
SetVisibilityTypes(visibilityTypes: LuaTableData): boolean;
|
|
191
|
+
}
|
|
192
|
+
interface InputActionsApi {
|
|
193
|
+
FindAction(actionName: string): InputAction | undefined;
|
|
194
|
+
}
|
|
195
|
+
type InputActions = InputActionsApi;
|
|
196
|
+
const InputActions: InputActionsApi;
|
|
197
|
+
interface InputAction {
|
|
198
|
+
Disable(): void;
|
|
199
|
+
Enable(): void;
|
|
200
|
+
IsPressed(): boolean;
|
|
201
|
+
OnPerformed(func: () => void): void;
|
|
202
|
+
}
|
|
203
|
+
interface Drop {
|
|
204
|
+
PickUp(): void;
|
|
205
|
+
}
|
|
206
|
+
interface ThrowableItem {
|
|
207
|
+
SimulateThrowTrajectory(throwState: EThrowState): LuaArray<Vector3>;
|
|
208
|
+
}
|
|
209
|
+
interface LocalizationApi {
|
|
210
|
+
GetTranslation(term: string): string;
|
|
211
|
+
}
|
|
212
|
+
type Localization = LocalizationApi;
|
|
213
|
+
const Localization: LocalizationApi;
|
|
214
|
+
interface NotificationControllerApi {
|
|
215
|
+
OnHint(callback: (event: HintNotificationEvent) => void): EventSubscription;
|
|
216
|
+
OnNotification(callback: (event: NotificationEvent) => void): EventSubscription;
|
|
217
|
+
OnViolationNotification(callback: (event: ViolationNotificationEvent) => void): EventSubscription;
|
|
218
|
+
ShowHint(message: string, duration?: number): void;
|
|
219
|
+
ShowNotification(message: string, duration: number): void;
|
|
220
|
+
}
|
|
221
|
+
type NotificationController = NotificationControllerApi;
|
|
222
|
+
const NotificationController: NotificationControllerApi;
|
|
223
|
+
interface PingControllerApi {
|
|
224
|
+
OnPing(callback: (event: PingEvent) => void): EventSubscription;
|
|
225
|
+
SetPing(position: Vector3): void;
|
|
226
|
+
}
|
|
227
|
+
type PingController = PingControllerApi;
|
|
228
|
+
const PingController: PingControllerApi;
|
|
229
|
+
/** @noSelf */
|
|
230
|
+
interface PhysicsApi {
|
|
231
|
+
Raycast(origin: Vector3, direction: Vector3, maxDistance: number): RaycastHit;
|
|
232
|
+
Raycast(origin: Vector3, direction: Vector3): RaycastHit;
|
|
233
|
+
}
|
|
234
|
+
type Physics = PhysicsApi;
|
|
235
|
+
const Physics: PhysicsApi;
|
|
236
|
+
interface SchedulerApi {
|
|
237
|
+
OnFrame(callback: () => void): EventSubscription;
|
|
238
|
+
}
|
|
239
|
+
interface ShopApi {
|
|
240
|
+
BuyAndDropItem(itemName: string): void;
|
|
241
|
+
BuyItem(itemName: string): void;
|
|
242
|
+
CanSellItem(itemName: string): boolean;
|
|
243
|
+
HasBoughtItem(itemName: string): boolean;
|
|
244
|
+
IsBuyLimitReachedForItem(itemName: string): boolean;
|
|
245
|
+
SellItem(itemName: string): void;
|
|
246
|
+
}
|
|
247
|
+
type Shop = ShopApi;
|
|
248
|
+
const Shop: ShopApi;
|
|
249
|
+
interface TexturesApi {
|
|
250
|
+
GetTexture(textureName: string): Texture | undefined;
|
|
251
|
+
}
|
|
252
|
+
type Textures = TexturesApi;
|
|
253
|
+
const Textures: TexturesApi;
|
|
254
|
+
type BackgroundPositionKeyword = 0 | 1 | 2 | 3 | 4;
|
|
255
|
+
const BackgroundPositionKeyword: {
|
|
256
|
+
readonly Left: 0;
|
|
257
|
+
readonly Center: 1;
|
|
258
|
+
readonly Right: 2;
|
|
259
|
+
readonly Top: 3;
|
|
260
|
+
readonly Bottom: 4;
|
|
261
|
+
};
|
|
262
|
+
type BackgroundSizeType = 0 | 1 | 2;
|
|
263
|
+
const BackgroundSizeType: {
|
|
264
|
+
readonly Contain: 0;
|
|
265
|
+
readonly Cover: 1;
|
|
266
|
+
readonly Auto: 2;
|
|
267
|
+
};
|
|
268
|
+
type DisplayStyle = 0 | 1;
|
|
269
|
+
const DisplayStyle: {
|
|
270
|
+
readonly Flex: 0;
|
|
271
|
+
readonly None: 1;
|
|
272
|
+
};
|
|
273
|
+
type TextAnchor = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
274
|
+
const TextAnchor: {
|
|
275
|
+
readonly UpperLeft: 0;
|
|
276
|
+
readonly UpperCenter: 1;
|
|
277
|
+
readonly UpperRight: 2;
|
|
278
|
+
readonly MiddleLeft: 3;
|
|
279
|
+
readonly MiddleCenter: 4;
|
|
280
|
+
readonly MiddleRight: 5;
|
|
281
|
+
readonly LowerLeft: 6;
|
|
282
|
+
readonly LowerCenter: 7;
|
|
283
|
+
readonly LowerRight: 8;
|
|
284
|
+
};
|
|
285
|
+
type WindowVisibilityType = 0 | 1 | 2;
|
|
286
|
+
const WindowVisibilityType: {
|
|
287
|
+
readonly Match: 0;
|
|
288
|
+
readonly Spectate: 1;
|
|
289
|
+
readonly Killcam: 2;
|
|
290
|
+
};
|
|
291
|
+
interface PlayerRankDisplayApi {
|
|
292
|
+
BindAgent(agent: Agent, cntAvatarRank: VisualElement, imgRank: VisualElement): void;
|
|
293
|
+
Clear(cntAvatarRank: VisualElement, imgRank: VisualElement): void;
|
|
294
|
+
}
|
|
295
|
+
type PlayerRankDisplay = PlayerRankDisplayApi;
|
|
296
|
+
const PlayerRankDisplay: PlayerRankDisplayApi;
|
|
297
|
+
interface UIApi {
|
|
298
|
+
readonly IsConsoleVisible: boolean;
|
|
299
|
+
readonly IsCursorUnlocked: boolean;
|
|
300
|
+
readonly IsExclusiveWindowOpen: boolean;
|
|
301
|
+
readonly IsWindowOpen: boolean;
|
|
302
|
+
BlurBackground(element: VisualElement): boolean;
|
|
303
|
+
BuildFromUxml(path: string, id: string, title: string, anchorMode: string, posX: string, posY: string): VisualElement;
|
|
304
|
+
BuildFromUxmlAbsolute(path: string): VisualElement;
|
|
305
|
+
BuildFromUxmlAbsoluteCenter(path: string, id: string, title: string): VisualElement;
|
|
306
|
+
BuildFromUxmlInteractive(path: string): VisualElement;
|
|
307
|
+
CloseWindow(element: VisualElement, hideVisual?: boolean): boolean;
|
|
308
|
+
CreateFromUxml(path: string): VisualElement;
|
|
309
|
+
CreateLabel(): TextElement;
|
|
310
|
+
CreateVisualElement(): VisualElement | undefined;
|
|
311
|
+
Delete(element: VisualElement): boolean;
|
|
312
|
+
GetMousePosition(): Vector2;
|
|
313
|
+
HideOverlappingUI(element: VisualElement): boolean;
|
|
314
|
+
LockCursor(element: VisualElement): boolean;
|
|
315
|
+
LockPlayerInput(element: VisualElement): boolean;
|
|
316
|
+
OpenWindow(element: VisualElement, unlockCursor: boolean, lockInput: boolean, hideOverlappingUI: boolean, blurBackground: boolean): boolean;
|
|
317
|
+
Q(root: VisualElement, id: string): VisualElement;
|
|
318
|
+
RemoveFromHierarchy(root: VisualElement): void;
|
|
319
|
+
ScheduleAnimation(root: VisualElement, paramsTable: LuaTableData): Tweener;
|
|
320
|
+
SetWindowVisibilityTypes(element: VisualElement, visibilityTypes: LuaTableData): boolean;
|
|
321
|
+
ShowOverlappingUI(element: VisualElement): boolean;
|
|
322
|
+
ToUpperInvariant(text: string): string;
|
|
323
|
+
UiToViewportPoint(uiPoint: Vector2): Vector2;
|
|
324
|
+
UnblurBackground(element: VisualElement): boolean;
|
|
325
|
+
UnlockCursor(element: VisualElement): boolean;
|
|
326
|
+
UnlockPlayerInput(element: VisualElement): boolean;
|
|
327
|
+
ViewportToUiPoint(viewportPoint: Vector3): Vector2;
|
|
328
|
+
}
|
|
329
|
+
type UI = UIApi;
|
|
330
|
+
const UI: UIApi;
|
|
331
|
+
interface DotViewElement extends VisualElement {
|
|
332
|
+
count: number;
|
|
333
|
+
fillToValue: boolean;
|
|
334
|
+
value: number;
|
|
335
|
+
Reset(): void;
|
|
336
|
+
}
|
|
337
|
+
interface ElementStyleApi {
|
|
338
|
+
backgroundColor: Color;
|
|
339
|
+
backgroundImage: Texture;
|
|
340
|
+
backgroundPositionX: BackgroundPositionKeyword;
|
|
341
|
+
backgroundPositionY: BackgroundPositionKeyword;
|
|
342
|
+
backgroundSize: BackgroundSizeType;
|
|
343
|
+
borderRadius: number;
|
|
344
|
+
bottom: number;
|
|
345
|
+
color: Color;
|
|
346
|
+
display: DisplayStyle;
|
|
347
|
+
height: number;
|
|
348
|
+
heightPercent: number;
|
|
349
|
+
left: number;
|
|
350
|
+
marginBottom: number;
|
|
351
|
+
marginLeft: number;
|
|
352
|
+
marginRight: number;
|
|
353
|
+
marginTop: number;
|
|
354
|
+
maxHeight: number;
|
|
355
|
+
maxWidth: number;
|
|
356
|
+
minHeight: number;
|
|
357
|
+
minWidth: number;
|
|
358
|
+
opacity: number;
|
|
359
|
+
right: number;
|
|
360
|
+
rotate: number;
|
|
361
|
+
rotateAngle: number;
|
|
362
|
+
scale: Vector3;
|
|
363
|
+
tintColor: Color;
|
|
364
|
+
top: number;
|
|
365
|
+
translate: Vector3;
|
|
366
|
+
width: number;
|
|
367
|
+
widthPercent: number;
|
|
368
|
+
}
|
|
369
|
+
type ElementStyle = ElementStyleApi;
|
|
370
|
+
const ElementStyle: ElementStyleApi;
|
|
371
|
+
interface ImageElement extends VisualElement {
|
|
372
|
+
texture: Texture;
|
|
373
|
+
}
|
|
374
|
+
interface ScrollView extends VisualElement {
|
|
375
|
+
CanScrollByDelta(deltaY: number): boolean;
|
|
376
|
+
DisableAutoScroll(): void;
|
|
377
|
+
EnableAutoScroll(): void;
|
|
378
|
+
RefreshVerticalScrollerVisibility(): void;
|
|
379
|
+
ScrollByDelta(deltaY: number): boolean;
|
|
380
|
+
ScrollToBottom(): void;
|
|
381
|
+
ScrollToTop(): void;
|
|
382
|
+
}
|
|
383
|
+
interface TextElement extends VisualElement {
|
|
384
|
+
text: string;
|
|
385
|
+
}
|
|
386
|
+
interface TextFieldElement extends VisualElement {
|
|
387
|
+
readonly IsFocused: boolean;
|
|
388
|
+
value: string;
|
|
389
|
+
Focus(): void;
|
|
390
|
+
}
|
|
391
|
+
interface Tweener {
|
|
392
|
+
IsComplete(): boolean;
|
|
393
|
+
Stop(complete?: boolean): void;
|
|
394
|
+
}
|
|
395
|
+
interface VisualElement {
|
|
396
|
+
readonly childCount: number;
|
|
397
|
+
readonly hasChildren: boolean;
|
|
398
|
+
readonly height: number;
|
|
399
|
+
readonly name: string;
|
|
400
|
+
readonly style: ElementStyle;
|
|
401
|
+
visible: boolean;
|
|
402
|
+
readonly width: number;
|
|
403
|
+
readonly windowScale: number;
|
|
404
|
+
Add(element: VisualElement): void;
|
|
405
|
+
AddToClassList(className: string): void;
|
|
406
|
+
Clear(): void;
|
|
407
|
+
Delete(): boolean;
|
|
408
|
+
EnableInClassList(className: string, value: boolean): void;
|
|
409
|
+
EnableMouseEvents(): void;
|
|
410
|
+
GetChild(name: string): VisualElement;
|
|
411
|
+
GetChildAt(index: number): VisualElement;
|
|
412
|
+
GetPickingMode(): number;
|
|
413
|
+
OnClick(callback: () => void): void;
|
|
414
|
+
OnMouseEnter(callback: () => void): void;
|
|
415
|
+
OnMouseLeave(callback: () => void): void;
|
|
416
|
+
OnPointerDown(callback: () => void): void;
|
|
417
|
+
RemoveFromHierarchy(): void;
|
|
418
|
+
ScheduleAnimation(pars: LuaTableData): Tweener;
|
|
419
|
+
SendToBack(): void;
|
|
420
|
+
SetBorderColor(color: Color): void;
|
|
421
|
+
SetCursor(cursorName: string): boolean;
|
|
422
|
+
SetName(name: string): void;
|
|
423
|
+
SetPickingMode(mode: number): void;
|
|
424
|
+
}
|
|
425
|
+
interface WorldVisualsApi {
|
|
426
|
+
CreateLineRenderer(): LineRenderer | undefined;
|
|
427
|
+
CreateSurfaceOverlay(): SurfaceOverlay | undefined;
|
|
428
|
+
RemoveObject(toRemove: WorldObject): void;
|
|
429
|
+
}
|
|
430
|
+
type WorldVisuals = WorldVisualsApi;
|
|
431
|
+
const WorldVisuals: WorldVisualsApi;
|
|
432
|
+
interface LineRenderer extends WorldObject {
|
|
433
|
+
PositionCount: number;
|
|
434
|
+
SetColor(color: Color): void;
|
|
435
|
+
SetDistanceWidth(nearWidth: number, farWidth: number, nearDistance: number, farDistance: number): void;
|
|
436
|
+
SetOccludedVisibility(brightness: number, transparency: number): void;
|
|
437
|
+
SetPatternEnabled(enabled: boolean): void;
|
|
438
|
+
SetPatternRepeat(repeatCount: number): void;
|
|
439
|
+
SetPatternTexture(texture: Texture): void;
|
|
440
|
+
SetPosition(index: number, position: Vector3): void;
|
|
441
|
+
SetPositionCount(count: number): void;
|
|
442
|
+
SetPositions(table: LuaTableData): void;
|
|
443
|
+
SetPositions(points: LuaArray<Vector3>): void;
|
|
444
|
+
SetProgress(progress: number): void;
|
|
445
|
+
SetWidth(width: number): void;
|
|
446
|
+
}
|
|
447
|
+
interface SurfaceOverlay extends WorldObject {
|
|
448
|
+
SetColor(color: Color): void;
|
|
449
|
+
SetFillBase(fillBase: number): void;
|
|
450
|
+
SetOcclusionEnabled(on: boolean): void;
|
|
451
|
+
SetPosition(position: Vector3): void;
|
|
452
|
+
SetSize(size: Vector3): void;
|
|
453
|
+
SetVisible(on: boolean): void;
|
|
454
|
+
}
|
|
455
|
+
interface WorldObject {
|
|
456
|
+
}
|
|
457
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./shared.js";
|
|
2
|
+
export {};
|
|
3
|
+
declare global {
|
|
4
|
+
interface Aim {
|
|
5
|
+
ResetAimTarget(): void;
|
|
6
|
+
SetAimTarget(targetPosition: Vector3, agent: Agent): void;
|
|
7
|
+
}
|
|
8
|
+
interface FirearmItem {
|
|
9
|
+
GetPredictedHits(): LuaArray<LuaArray<HitscanHit>>;
|
|
10
|
+
}
|
|
11
|
+
interface SchedulerApi {
|
|
12
|
+
OnTick(callback: () => void): EventSubscription;
|
|
13
|
+
}
|
|
14
|
+
}
|