UNPKG

s2ts

Version:

A tool to automatically compile counter-strike TS files (.vts files)

151 lines (150 loc) 4.02 kB
import { Color } from "../color"; import { Vector } from "../vector"; declare const PropDynamicSolid: { readonly none: 0; readonly bsp: 1; readonly bbox: 2; readonly obb: 3; readonly sphere: 4; readonly point: 5; readonly vphysics: 6; readonly capsule: 7; readonly last: 8; }; declare const PointWorldTextJustifyHorizontal: { readonly left: 0; readonly center: 1; readonly right: 2; }; declare const PointWorldTextJustifyVertical: { readonly top: 0; readonly center: 1; readonly bottom: 2; }; declare const PointWorldTextReorientMode: { readonly none: 0; readonly "rotate-around-up": 1; }; declare const LogicEventListenerTeam: { readonly "dont-care": -1; readonly terrorists: 2; readonly "counter-terrorists": 3; }; declare const PointSoundEventEntityIndexSelection: { readonly "use-world-index": 0; readonly "use-entity-index": 1; }; type EntityDefinition = { class: "prop_dynamic"; keyValues: { model: string; solid: keyof typeof PropDynamicSolid; renderAmount: number; renderColor: Color; }; outputs: { onIgnite: () => void; onBreak: () => void; onHealthChanged: () => void; onTakeDamage: () => void; onAnimationBegun: () => void; onAnimationDone: () => void; onAnimationReachedEnd: () => void; onAnimationReachedStart: () => void; onAnimationLoopCycleDone: () => void; }; } | { class: "logic_timer"; keyValues: { refireTime: number; }; outputs: { onTimer: () => void; onTimerHigh: () => void; onTimerLow: () => void; }; } | { class: "env_explosion"; keyValues: { magnitude: number; sound: string; }; outputs: {}; } | { class: "point_worldtext"; keyValues: { message: string; enabled: boolean; fontSize: number; color: Color; worldUnitsPerPixel: number; fontName: string; justifyHorizontal: keyof typeof PointWorldTextJustifyHorizontal; justifyVertical: keyof typeof PointWorldTextJustifyVertical; reorientMode: keyof typeof PointWorldTextReorientMode; depthRenderOffset: number; }; outputs: {}; } | { class: "env_fade"; keyValues: { duration: number; holdTime: number; renderColor: Color; renderAmount: number; }; outputs: { onBeginFade: () => void; }; } | { class: "logic_eventlistener"; keyValues: { eventName: string; enabled: boolean; team: keyof typeof LogicEventListenerTeam; }; outputs: { onEventFired: () => void; }; } | { class: "point_soundevent"; keyValues: { soundName: string; sourceEntityName: string; startOnSpawn: boolean; toLocalPlayer: boolean; retirggerStopsLast: boolean; saveAndRestore: boolean; entityAttachmentName: string; entityIndexSelection: keyof typeof PointSoundEventEntityIndexSelection; }; outputs: { soundEventGuid: () => void; onSoundFinished: () => void; }; }; type CommonEntityKeyValues = { targetName: string; origin: Vector; angles: Vector; }; type CommonEntityOutputs = { onUser1: () => void; onUser2: () => void; onUser3: () => void; onUser4: () => void; onKilled: () => void; }; type MiscKeyValues = Record<string, string | number | boolean | Vector | Color | undefined>; type EntityDefinitionOptional = EntityDefinition extends infer TEntity ? TEntity extends { class: infer TClass; keyValues: infer TKeyValues; outputs: infer TOutputs; } ? { class: TClass; keyValues?: Partial<CommonEntityKeyValues & TKeyValues>; keyValueOverrides?: MiscKeyValues; outputs?: Partial<TOutputs & CommonEntityOutputs>; } : never : never; export declare const createEntity: (entity: EntityDefinitionOptional) => void; export {};