diff --git a/src/acceltween/index.d.ts b/src/acceltween/index.d.ts new file mode 100644 index 00000000000..7ff41bdbaee --- /dev/null +++ b/src/acceltween/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AccelTween'; diff --git a/src/acceltween/src/Shared/AccelTween.d.ts b/src/acceltween/src/Shared/AccelTween.d.ts new file mode 100644 index 00000000000..5611b99c61c --- /dev/null +++ b/src/acceltween/src/Shared/AccelTween.d.ts @@ -0,0 +1,15 @@ +type AccelTween = { + p: number; + v: number; + a: number; + t: number; + rtime: number; + pt: number; +}; + +interface AccelTweenConstructor { + readonly ClassName: 'AccelTween'; + new (maxAcceleration?: number): AccelTween; +} + +export const AccelTween: AccelTweenConstructor; diff --git a/src/accessorytypeutils/index.d.ts b/src/accessorytypeutils/index.d.ts new file mode 100644 index 00000000000..a026cec2965 --- /dev/null +++ b/src/accessorytypeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AccessoryTypeUtils'; diff --git a/src/accessorytypeutils/src/Shared/AccessoryTypeUtils.d.ts b/src/accessorytypeutils/src/Shared/AccessoryTypeUtils.d.ts new file mode 100644 index 00000000000..0f5d2ed4375 --- /dev/null +++ b/src/accessorytypeutils/src/Shared/AccessoryTypeUtils.d.ts @@ -0,0 +1,12 @@ +export namespace AccessoryTypeUtils { + function tryGetAccessoryType( + avatarAssetType: Enum.AvatarAssetType + ): LuaTuple<[accessoryType?: Enum.AccessoryType, err?: string]>; + function getAccessoryTypeFromName(accessoryType: string): Enum.AccessoryType; + function convertAssetTypeIdToAssetType( + assetTypeId: number + ): Enum.AssetType | undefined; + function convertAssetTypeIdToAvatarAssetType( + avatarAssetTypeId: number + ): Enum.AvatarAssetType | undefined; +} diff --git a/src/actionmanager/index.d.ts b/src/actionmanager/index.d.ts new file mode 100644 index 00000000000..76cf4f17023 --- /dev/null +++ b/src/actionmanager/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/ActionManager'; +export * from './src/Client/BaseAction'; diff --git a/src/actionmanager/src/Client/ActionManager.d.ts b/src/actionmanager/src/Client/ActionManager.d.ts new file mode 100644 index 00000000000..a5ce87a4dbb --- /dev/null +++ b/src/actionmanager/src/Client/ActionManager.d.ts @@ -0,0 +1,23 @@ +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; +import { BaseAction } from './BaseAction'; + +interface ActionManager { + ActiveAction: ValueObject; + ActionAdded: Signal; + StopCurrentAction(): void; + ActivateAction(action: T, ...args: unknown[]): void; + GetAction(name: string): BaseAction | undefined; + GetActions(): BaseAction[]; + AddAction(action: BaseAction): void; + Destroy(): void; +} + +interface ActionManagerConstructor { + readonly ClassName: 'ActionManager'; + new (parent?: Instance): ActionManager; + + ExtraPixels: 2; +} + +export const ActionManager: ActionManagerConstructor; diff --git a/src/actionmanager/src/Client/BaseAction.d.ts b/src/actionmanager/src/Client/BaseAction.d.ts new file mode 100644 index 00000000000..e3e6ca332b0 --- /dev/null +++ b/src/actionmanager/src/Client/BaseAction.d.ts @@ -0,0 +1,40 @@ +import { EnabledMixin } from '@quenty/enabledmixin'; +import { Maid } from '@quenty/maid'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +export interface ActionData { + Name: string; + Shortcuts?: (Enum.KeyCode | Enum.UserInputType)[]; +} + +interface BaseAction extends EnabledMixin { + Activated: Signal< + [ + actionMaid: Maid, + ...activateData: T extends void ? [] : T extends unknown[] ? T : [T] + ] + >; + Deactivated: Signal; + IsActivatedValue: ValueObject; + GetName(): string; + GetData(): ActionData; + ToggleActivate( + ...activateData: T extends void ? [] : T extends unknown[] ? T : [T] + ): void; + IsActive(): boolean; + Deactivate(): void; + Activate( + ...activateData: T extends void ? [] : T extends unknown[] ? T : [T] + ): void; + Destroy(): void; +} + +interface BaseActionConstructor { + readonly ClassName: 'BaseAction'; + new ( + actionData: ActionData + ): BaseAction; +} + +export const BaseAction: BaseActionConstructor; diff --git a/src/adorneeboundingbox/index.d.ts b/src/adorneeboundingbox/index.d.ts new file mode 100644 index 00000000000..f5a2320a5ce --- /dev/null +++ b/src/adorneeboundingbox/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Shared/AdorneeBoundingBox'; +export * from './src/Shared/AdorneeModelBoundingBox'; +export * from './src/Shared/AdorneePartBoundingBox'; +export * from './src/Shared/RxPartBoundingBoxUtils'; diff --git a/src/adorneeboundingbox/src/Shared/AdorneeBoundingBox.d.ts b/src/adorneeboundingbox/src/Shared/AdorneeBoundingBox.d.ts new file mode 100644 index 00000000000..1baff331b92 --- /dev/null +++ b/src/adorneeboundingbox/src/Shared/AdorneeBoundingBox.d.ts @@ -0,0 +1,24 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface BoundingBoxData { + CFrame: CFrame; + Size: Vector3; +} + +interface AdorneeBoundingBox extends BaseObject { + SetAdornee(adornee: Instance | undefined): () => void; + ObserveBoundingBox(): Observable; + GetBoundingBox(): BoundingBoxData | undefined; + ObserveCFrame(): Observable; + GetCFrame(): CFrame | undefined; + ObserveSize(): Observable; + GetSize(): Vector3 | undefined; +} + +interface AdorneeBoundingBoxConstructor { + readonly ClassName: 'AdorneeBoundingBox'; + new (initialAdornee?: Instance): AdorneeBoundingBox; +} + +export const AdorneeBoundingBox: AdorneeBoundingBoxConstructor; diff --git a/src/adorneeboundingbox/src/Shared/AdorneeModelBoundingBox.d.ts b/src/adorneeboundingbox/src/Shared/AdorneeModelBoundingBox.d.ts new file mode 100644 index 00000000000..0b760d705a3 --- /dev/null +++ b/src/adorneeboundingbox/src/Shared/AdorneeModelBoundingBox.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface AdorneeModelBoundingBox extends BaseObject { + ObserveCFrame(): Observable; + ObserveSize(): Observable; +} + +interface AdorneeModelBoundingBoxConstructor { + readonly ClassName: 'AdorneeModelBoundingBox'; + new (model: Model): AdorneeModelBoundingBox; +} + +export const AdorneeModelBoundingBox: AdorneeModelBoundingBoxConstructor; diff --git a/src/adorneeboundingbox/src/Shared/AdorneePartBoundingBox.d.ts b/src/adorneeboundingbox/src/Shared/AdorneePartBoundingBox.d.ts new file mode 100644 index 00000000000..7258d9e18ed --- /dev/null +++ b/src/adorneeboundingbox/src/Shared/AdorneePartBoundingBox.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface AdorneePartBoundingBox extends BaseObject { + ObserveCFrame(): Observable; + ObserveSize(): Observable; +} + +interface AdorneePartBoundingBoxConstructor { + readonly ClassName: 'AdorneePartBoundingBox'; + new (part: BasePart): AdorneePartBoundingBox; +} + +export const AdorneePartBoundingBox: AdorneePartBoundingBoxConstructor; diff --git a/src/adorneeboundingbox/src/Shared/RxPartBoundingBoxUtils.d.ts b/src/adorneeboundingbox/src/Shared/RxPartBoundingBoxUtils.d.ts new file mode 100644 index 00000000000..9f200288ed6 --- /dev/null +++ b/src/adorneeboundingbox/src/Shared/RxPartBoundingBoxUtils.d.ts @@ -0,0 +1,5 @@ +import { Observable } from '@quenty/rx'; + +export namespace RxPartBoundingBoxUtils { + function observePartCFrame(part: BasePart): Observable; +} diff --git a/src/adorneedata/index.d.ts b/src/adorneedata/index.d.ts new file mode 100644 index 00000000000..b1758b92371 --- /dev/null +++ b/src/adorneedata/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/AdorneeData'; +export * from './src/Shared/AdorneeDataEntry'; +export * from './src/Shared/AdorneeDataValue'; diff --git a/src/adorneedata/src/Shared/AdorneeData.d.ts b/src/adorneedata/src/Shared/AdorneeData.d.ts new file mode 100644 index 00000000000..d8f54acf4cf --- /dev/null +++ b/src/adorneedata/src/Shared/AdorneeData.d.ts @@ -0,0 +1,44 @@ +import { AttributeValue } from '@quenty/attributeutils'; +import { Observable } from '@quenty/rx'; +import { AdorneeDataValue } from './AdorneeDataValue'; +import { AdorneeDataEntry } from './AdorneeDataEntry'; + +export type ToAdorneeEntries | unknown> = + T extends unknown + ? {} + : { + [K in keyof T]: Readonly< + T[K] extends AdorneeDataEntry + ? AdorneeDataEntry + : T[K] extends Record + ? never + : AdorneeDataEntry + >; + }; + +type AdorneeData> = + ToAdorneeEntries & { + IsStrictData( + data: unknown + ): LuaTuple<[success: boolean, errorMessage: string]>; + CreateStrictData(data: Y): Readonly; + CreateFullData(data: Partial): Readonly; + CreateData>(data: Y): Readonly; + Observe(adornee: Instance): Observable; + Create(adornee: Instance): AdorneeDataValue; + Get(adornee: Instance): Readonly; + Set(adornee: Instance, data: Partial): void; + Unset(adornee: Instance): void; + SetStrict(adornee: Instance, data: T): void; + InitAttributes(adornee: Instance, data: Partial | undefined): void; + GetStrictTInterface(): (data: unknown) => data is T; + GetTInterface(): (data: unknown) => data is Partial; + IsData(data: unknown): data is Partial; + }; + +interface AdorneeDataConstructor { + readonly ClassName: 'AdorneeData'; + new >(prototype: T): AdorneeData; +} + +export const AdorneeData: AdorneeDataConstructor; diff --git a/src/adorneedata/src/Shared/AdorneeDataEntry.d.ts b/src/adorneedata/src/Shared/AdorneeDataEntry.d.ts new file mode 100644 index 00000000000..3e510994686 --- /dev/null +++ b/src/adorneedata/src/Shared/AdorneeDataEntry.d.ts @@ -0,0 +1,39 @@ +import { AttributeValue } from '@quenty/attributeutils'; +import { Observable } from '@quenty/rx'; +import { ValueObjectLike } from '@quenty/valueobject'; + +type ValueInterface = ( + value: unknown +) => + | boolean + | ( + | LuaTuple<[success: true, errorMessage: undefined]> + | LuaTuple<[success: false, errorMessage: string]> + ); + +type AdorneeDataEntry = { + Create(adornee: Instance): AttributeValue; + Observe(adornee: Instance): Observable; + Get(adornee: Instance): T; + Set(adornee: Instance, value: T): void; + GetDefaultValue(): T | undefined; + GetStrictInterface(): ValueInterface; + IsValid(value: unknown): value is T; +}; + +interface AdorneeDataEntryConstructor { + readonly ClassName: 'AdorneeDataEntry'; + new ( + interface: T, + createValueObject: (adornee: Instance) => ValueObjectLike value is infer V ? V : CheckableTypes[T]>, + defaultValue?: T extends (value: unknown) => value is infer V ? NonNullable : CheckableTypes[T] + ): AdorneeDataEntry value is infer V ? V : CheckableTypes[T]>; + + isAdorneeDataEntry: (value: unknown) => value is AdorneeDataEntry; + optionalAttribute: ( + interface: string | ValueInterface, + name: string + ) => AdorneeDataEntry; +} + +export const AdorneeDataEntry: AdorneeDataEntryConstructor; diff --git a/src/adorneedata/src/Shared/AdorneeDataValue.d.ts b/src/adorneedata/src/Shared/AdorneeDataValue.d.ts new file mode 100644 index 00000000000..c228fbef0fd --- /dev/null +++ b/src/adorneedata/src/Shared/AdorneeDataValue.d.ts @@ -0,0 +1,35 @@ +import { AdorneeData, AdorneeDataEntry } from '@quenty/adorneedata'; +import { AttributeValue } from '@quenty/attributeutils'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ValueObjectLike } from '@quenty/valueobject'; + +type MapToValues | unknown> = + T extends Record + ? Readonly<{ + [K in keyof T]: T[K] extends AdorneeDataEntry + ? ValueObjectLike + : AttributeValue; + }> + : {}; + +export type FromAdorneeData> = + T extends AdorneeData ? AdorneeDataValue : never; + +type AdorneeDataValue = MapToValues & { + Value: T; + readonly Changed: Signal; + Observe(): Observable; +}; + +interface AdorneeDataValueConstructor { + readonly ClassName: 'AdorneeDataValue'; + new ( + adornee: Instance, + prototype: Record + ): AdorneeDataValue; + + isAdorneeDataValue: (value: unknown) => value is AdorneeDataValue; +} + +export const AdorneeDataValue: AdorneeDataValueConstructor; diff --git a/src/adorneeutils/index.d.ts b/src/adorneeutils/index.d.ts new file mode 100644 index 00000000000..18903555ef5 --- /dev/null +++ b/src/adorneeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AdorneeUtils'; diff --git a/src/adorneeutils/src/Shared/AdorneeUtils.d.ts b/src/adorneeutils/src/Shared/AdorneeUtils.d.ts new file mode 100644 index 00000000000..60689e36be4 --- /dev/null +++ b/src/adorneeutils/src/Shared/AdorneeUtils.d.ts @@ -0,0 +1,14 @@ +export namespace AdorneeUtils { + function getCenter(adornee: Instance): Vector3 | undefined; + function getBoundingBox( + adornee: Instance + ): LuaTuple<[cframe?: CFrame, size?: Vector3]>; + function isPartOfAdornee(adornee: Instance, part: BasePart): boolean; + function getParts(adornee: Instance): BasePart[]; + function getAlignedSize(adornee: Instance): Vector3 | undefined; + function getPartCFrame(adornee: Instance): CFrame | undefined; + function getPartPosition(adornee: Instance): Vector3 | undefined; + function getPartVelocity(adornee: Instance): Vector3 | undefined; + function getPart(adornee: Instance): BasePart | undefined; + function getRenderAdornee(adornee: Instance): Instance | undefined; +} diff --git a/src/adorneevalue/index.d.ts b/src/adorneevalue/index.d.ts new file mode 100644 index 00000000000..8aeccd5260f --- /dev/null +++ b/src/adorneevalue/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AdorneeValue'; diff --git a/src/adorneevalue/src/Shared/AdorneeValue.d.ts b/src/adorneevalue/src/Shared/AdorneeValue.d.ts new file mode 100644 index 00000000000..a700ec5f39f --- /dev/null +++ b/src/adorneevalue/src/Shared/AdorneeValue.d.ts @@ -0,0 +1,40 @@ +import { Signal } from '@quenty/signal'; +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +type AdorneeValueOption = Instance | CFrame | Vector3; + +interface AdorneeValue extends BaseObject { + Value: AdorneeValueOption | undefined; + readonly Changed: Signal< + [new: AdorneeValueOption | undefined, old: AdorneeValueOption | undefined] + >; + GetAdornee(): AdorneeValueOption | undefined; + Observe(): Observable; + ObserveBottomCFrame(): Observable; + ObserveCenterPosition(): Observable; + GetCenterPosition(): Vector3 | undefined; + ObserveRadius(): Observable; + GetRadius(): number | undefined; + ObservePositionTowards( + observeTargetPosition: Observable, + observeRadius?: Observable + ): Observable; + GetPositionTowards( + target: Vector3, + radius?: number, + center?: Vector3 + ): Vector3 | undefined; + ObserveAttachmentParent(): Observable; + RenderPositionAttachment(props?: { + WorldPosition?: Vector3; + Name?: string; + }): Observable; +} + +interface AdorneeValueConstructor { + readonly ClassName: 'AdorneeValue'; + new (): AdorneeValue; +} + +export const AdorneeValue: AdorneeValueConstructor; diff --git a/src/aggregator/index.d.ts b/src/aggregator/index.d.ts new file mode 100644 index 00000000000..1b89bdadaec --- /dev/null +++ b/src/aggregator/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Aggregator'; +export * from './src/Shared/RateAggregator'; diff --git a/src/aggregator/src/Shared/Aggregator.d.ts b/src/aggregator/src/Shared/Aggregator.d.ts new file mode 100644 index 00000000000..c436740f0a2 --- /dev/null +++ b/src/aggregator/src/Shared/Aggregator.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +interface Aggregator extends BaseObject { + SetMaxBatchSize(maxBatchSize: number): void; + Promise(id: number): Promise; + Observe(id: number): Observable; +} + +interface AggregatorConstructor { + readonly ClassName: 'Aggregator'; + new ( + debugName: string, + promiseBulkQuery: (idList: number[]) => Promise + ): Aggregator; +} + +export const Aggregator: AggregatorConstructor; diff --git a/src/aggregator/src/Shared/RateAggregator.d.ts b/src/aggregator/src/Shared/RateAggregator.d.ts new file mode 100644 index 00000000000..5fead1ccc5b --- /dev/null +++ b/src/aggregator/src/Shared/RateAggregator.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; + +interface RateAggregator extends BaseObject { + SetMaxRequestsPerSecond(maxRequestsPerSecond: number): void; + Promise(...args: A): Promise; +} + +interface RateAggregatorConstructor { + readonly ClassName: 'RateAggregator'; + new ( + promiseQuery: (...args: A) => Promise + ): RateAggregator; +} + +export const RateAggregator: RateAggregatorConstructor; diff --git a/src/animationgroup/index.d.ts b/src/animationgroup/index.d.ts new file mode 100644 index 00000000000..458828649b8 --- /dev/null +++ b/src/animationgroup/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/AnimationGroup'; +export * from './src/Shared/AnimationGroupUtils'; diff --git a/src/animationgroup/src/Shared/AnimationGroup.d.ts b/src/animationgroup/src/Shared/AnimationGroup.d.ts new file mode 100644 index 00000000000..3835535ffa0 --- /dev/null +++ b/src/animationgroup/src/Shared/AnimationGroup.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { WeightedTrack } from './AnimationGroupUtils'; + +interface AnimationGroup extends BaseObject { + Play(transitionTime?: number): void; + SetWeightedTracks( + weightedTracks: WeightedTrack[], + transitionTime?: number + ): void; + Stop(transitionTime?: number): void; +} + +interface AnimationGroupConstructor { + readonly ClassName: 'AnimationGroup'; + new (weightedTracks?: WeightedTrack[]): AnimationGroup; +} + +export const AnimationGroup: AnimationGroupConstructor; diff --git a/src/animationgroup/src/Shared/AnimationGroupUtils.d.ts b/src/animationgroup/src/Shared/AnimationGroupUtils.d.ts new file mode 100644 index 00000000000..128c6e5d25b --- /dev/null +++ b/src/animationgroup/src/Shared/AnimationGroupUtils.d.ts @@ -0,0 +1,27 @@ +export interface WeightedAnimation { + animationId: string; + weight: number; +} + +export interface WeightedTrack { + track: AnimationTrack; + weight: number; +} + +export namespace AnimationGroupUtils { + function createdWeightedTracks( + animatorOrHumanoid: Animator | Humanoid, + weightedAnimationList: WeightedAnimation[] + ): WeightedTrack[]; + function createdWeightedAnimation( + animationId: string, + weight: number + ): WeightedAnimation; + function createdWeightedTrack( + track: AnimationTrack, + weight: number + ): WeightedTrack; + function selectFromWeightedTracks( + weightedTracks: WeightedTrack[] + ): WeightedTrack | undefined; +} diff --git a/src/animationprovider/index.d.ts b/src/animationprovider/index.d.ts new file mode 100644 index 00000000000..b84aad050ba --- /dev/null +++ b/src/animationprovider/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AnimationProvider'; diff --git a/src/animationprovider/src/Shared/AnimationProvider.d.ts b/src/animationprovider/src/Shared/AnimationProvider.d.ts new file mode 100644 index 00000000000..390a29f8530 --- /dev/null +++ b/src/animationprovider/src/Shared/AnimationProvider.d.ts @@ -0,0 +1,3 @@ +import { TemplateProvider } from '@quenty/templateprovider'; + +export const AnimationProvider: TemplateProvider; diff --git a/src/animations/index.d.ts b/src/animations/index.d.ts new file mode 100644 index 00000000000..3e3788de6b2 --- /dev/null +++ b/src/animations/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Shared/AnimationPromiseUtils'; +export * from './src/Shared/AnimationSlotPlayer'; +export * from './src/Shared/AnimationTrackPlayer'; +export * from './src/Shared/AnimationUtils'; +export * from './src/Shared/Testing/StudioRigAnimator'; diff --git a/src/animations/src/Shared/AnimationPromiseUtils.d.ts b/src/animations/src/Shared/AnimationPromiseUtils.d.ts new file mode 100644 index 00000000000..dd9ee6b15ec --- /dev/null +++ b/src/animations/src/Shared/AnimationPromiseUtils.d.ts @@ -0,0 +1,13 @@ +import { Promise } from '@quenty/promise'; + +export namespace AnimationPromiseUtils { + function promiseFinished( + animationTrack: AnimationTrack, + endMarkerName?: string + ): Promise; + function promiseLoaded(animationTrack: AnimationTrack): Promise; + function promiseKeyframeReached( + animationTrack: AnimationTrack, + keyframeName: string + ): Promise; +} diff --git a/src/animations/src/Shared/AnimationSlotPlayer.d.ts b/src/animations/src/Shared/AnimationSlotPlayer.d.ts new file mode 100644 index 00000000000..465f6897f9c --- /dev/null +++ b/src/animations/src/Shared/AnimationSlotPlayer.d.ts @@ -0,0 +1,29 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Mountable } from '@quenty/valueobject'; + +interface AnimationSlotPlayer extends BaseObject { + SetDefaultFadeTime(defaultFadeTime: number): void; + SetDefaultAnimationPriority( + defaultAnimationPriority: Enum.AnimationPriority | undefined + ): void; + SetAnimationTarget(animationTarget: Mountable): void; + PromiseStopped(): Promise; + AdjustSpeed(id: string | number, speed: number): void; + AdjustWeight(id: string, weight: number, fadeTime?: number): void; + Play( + id: string | number, + fadeTime?: number, + weight?: number, + speed?: number, + priority?: Enum.AnimationPriority + ): () => void; + Stop(): void; +} + +interface AnimationSlotPlayerConstructor { + readonly ClassName: 'AnimationSlotPlayer'; + new (animationTarget?: Mountable): AnimationSlotPlayer; +} + +export const AnimationSlotPlayer: AnimationSlotPlayerConstructor; diff --git a/src/animations/src/Shared/AnimationTrackPlayer.d.ts b/src/animations/src/Shared/AnimationTrackPlayer.d.ts new file mode 100644 index 00000000000..4be29f8c482 --- /dev/null +++ b/src/animations/src/Shared/AnimationTrackPlayer.d.ts @@ -0,0 +1,26 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; +import { Mountable } from '@quenty/valueobject'; + +interface AnimationTrackPlayer extends BaseObject { + KeyframeReached: Signal; + SetAnimationId(animationId: string | number): void; + GetAnimationId(): string | number | undefined; + SetAnimationTarget(target: Mountable | undefined): void; + SetWeightTargetIfNotSet(weight: number, fadeTime?: number): void; + Play(fadeTime?: number, weight?: number, speed?: number): void; + Stop(fadeTime?: number): void; + AdjustWeight(weight: number, fadeTime?: number): void; + AdjustSpeed(speed: number, fadeTime?: number): void; + IsPlaying(): boolean; +} + +interface AnimationTrackPlayerConstructor { + readonly ClassName: 'AnimationTrackPlayer'; + new ( + animationTarget?: Mountable, + animationId?: string | number + ): AnimationTrackPlayer; +} + +export const AnimationTrackPlayer: AnimationTrackPlayerConstructor; diff --git a/src/animations/src/Shared/AnimationUtils.d.ts b/src/animations/src/Shared/AnimationUtils.d.ts new file mode 100644 index 00000000000..5eec3e9af54 --- /dev/null +++ b/src/animations/src/Shared/AnimationUtils.d.ts @@ -0,0 +1,37 @@ +export namespace AnimationUtils { + function playAnimation( + target: Animator | Player | Model | AnimationController, + id: string | number, + fadeTime?: number, + weight?: number, + speed?: number, + priority?: Enum.AnimationPriority + ): AnimationTrack | undefined; + function stopAnimation( + target: Animator | Player | Model | AnimationController, + id: string | number, + fadeTime?: number + ): AnimationTrack | undefined; + function getOrCreateAnimationTrack( + target: Animator | Player | Model | AnimationController, + id: string | number, + priority?: Enum.AnimationPriority + ): AnimationTrack | undefined; + function getOrCreateAnimationFromIdInAnimator( + animator: Animator, + id: string | number + ): Animation; + function findAnimationTrack( + target: Animator | Player | Model | AnimationController, + id: string | number + ): AnimationTrack | undefined; + function findAnimationTrackInAnimator( + animator: Animator, + id: string | number + ): AnimationTrack | undefined; + function getOrCreateAnimator( + target: Animator | Player | Model | Humanoid | AnimationController + ): Animator | undefined; + function getAnimationName(animationId: string): string; + function createAnimationFromId(id: string | number): Animation; +} diff --git a/src/animations/src/Shared/Testing/StudioRigAnimator.d.ts b/src/animations/src/Shared/Testing/StudioRigAnimator.d.ts new file mode 100644 index 00000000000..4eef8d37905 --- /dev/null +++ b/src/animations/src/Shared/Testing/StudioRigAnimator.d.ts @@ -0,0 +1,10 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface StudioRigAnimator extends BaseObject {} + +interface StudioRigAnimatorConstructor { + readonly ClassName: 'StudioRigAnimator'; + new (animatorOrHumanoid: Animator | Humanoid): StudioRigAnimator; +} + +export const StudioRigAnimator: StudioRigAnimatorConstructor; diff --git a/src/animationtrackutils/index.d.ts b/src/animationtrackutils/index.d.ts new file mode 100644 index 00000000000..d1795bb4032 --- /dev/null +++ b/src/animationtrackutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AnimationTrackUtils'; diff --git a/src/animationtrackutils/src/Shared/AnimationTrackUtils.d.ts b/src/animationtrackutils/src/Shared/AnimationTrackUtils.d.ts new file mode 100644 index 00000000000..16cb3706afb --- /dev/null +++ b/src/animationtrackutils/src/Shared/AnimationTrackUtils.d.ts @@ -0,0 +1,11 @@ +export namespace AnimationTrackUtils { + function loadAnimationFromId( + animatorOrHumanoid: Animator | Humanoid, + animationId: string + ): AnimationTrack; + function setWeightTargetIfNotSet( + track: AnimationTrack, + weight: number, + fadeTime: number + ): void; +} diff --git a/src/applytagtotaggedchildren/index.d.ts b/src/applytagtotaggedchildren/index.d.ts new file mode 100644 index 00000000000..91f8975ff0c --- /dev/null +++ b/src/applytagtotaggedchildren/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ApplyTagToTaggedChildren'; diff --git a/src/applytagtotaggedchildren/src/Shared/ApplyTagToTaggedChildren.d.ts b/src/applytagtotaggedchildren/src/Shared/ApplyTagToTaggedChildren.d.ts new file mode 100644 index 00000000000..53af7eabce6 --- /dev/null +++ b/src/applytagtotaggedchildren/src/Shared/ApplyTagToTaggedChildren.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '../../../baseobject'; + +interface ApplyTagToTaggedChildren extends BaseObject {} + +interface BrioConstructor { + readonly ClassName: 'ApplyTagToTaggedChildren'; + new ( + parent: Instance, + tag: string, + requiredTag: string + ): ApplyTagToTaggedChildren; +} + +export const ApplyTagToTaggedChildren: BrioConstructor; diff --git a/src/assetserviceutils/index.d.ts b/src/assetserviceutils/index.d.ts new file mode 100644 index 00000000000..48d21363e35 --- /dev/null +++ b/src/assetserviceutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/AssetServiceCache'; +export * from './src/Shared/AssetServiceUtils'; diff --git a/src/assetserviceutils/src/Shared/AssetServiceCache.d.ts b/src/assetserviceutils/src/Shared/AssetServiceCache.d.ts new file mode 100644 index 00000000000..49762f4489c --- /dev/null +++ b/src/assetserviceutils/src/Shared/AssetServiceCache.d.ts @@ -0,0 +1,10 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { AssetServiceUtils } from './AssetServiceUtils'; + +export interface AssetServiceCache { + readonly ServiceName: 'AssetServiceCache'; + Init(serviceBag: ServiceBag): void; + PromiseBundleDetails( + bundleId: number + ): ReturnType; +} diff --git a/src/assetserviceutils/src/Shared/AssetServiceUtils.d.ts b/src/assetserviceutils/src/Shared/AssetServiceUtils.d.ts new file mode 100644 index 00000000000..018618d26a9 --- /dev/null +++ b/src/assetserviceutils/src/Shared/AssetServiceUtils.d.ts @@ -0,0 +1,13 @@ +import { Promise } from '@quenty/promise'; + +export namespace AssetServiceUtils { + function promiseAssetIdsForPackage( + packageAssetId: number + ): Promise>; + function promiseGamePlaces(): Promise< + ReturnType + >; + function promiseBundleDetails( + bundleId: number + ): Promise>; +} diff --git a/src/attributeutils/index.d.ts b/src/attributeutils/index.d.ts new file mode 100644 index 00000000000..7d0fd886c83 --- /dev/null +++ b/src/attributeutils/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Shared/AttributeValue'; +export * from './src/Shared/AttributeUtils'; +export * from './src/Shared/EncodedAttributeValue'; +export * from './src/Shared/JSONAttributeValue'; +export * from './src/Shared/RxAttributeUtils'; diff --git a/src/attributeutils/package.json b/src/attributeutils/package.json index 9d5afa4e7ed..bf27e5de1bb 100644 --- a/src/attributeutils/package.json +++ b/src/attributeutils/package.json @@ -28,6 +28,7 @@ "Quenty" ], "dependencies": { + "@quenty/binder": "workspace:*", "@quenty/baseobject": "workspace:*", "@quenty/brio": "workspace:*", "@quenty/canceltoken": "workspace:*", diff --git a/src/attributeutils/src/Shared/AttributeUtils.d.ts b/src/attributeutils/src/Shared/AttributeUtils.d.ts new file mode 100644 index 00000000000..c1f8d751259 --- /dev/null +++ b/src/attributeutils/src/Shared/AttributeUtils.d.ts @@ -0,0 +1,30 @@ +import { Binder } from '@quenty/binder'; +import { CancelToken } from '@quenty/canceltoken'; +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +export namespace AttributeUtils { + function isValidAttributeType(valueType: string): boolean; + function promiseAttribute( + instance: Instance, + attributeName: string, + predicate?: (value: T) => boolean, + cancelToken?: CancelToken + ): Promise; + function bindToBinder( + instance: Instance, + attributeName: string, + binder: Binder + ): Maid; + function initAttribute( + instance: Instance, + attributeName: string, + defaultValue: T + ): T; + function getAttribute( + instance: Instance, + attributeName: string, + defaultValue?: T + ): T; + function removeAllAttributes(instance: Instance): void; +} diff --git a/src/attributeutils/src/Shared/AttributeValue.d.ts b/src/attributeutils/src/Shared/AttributeValue.d.ts new file mode 100644 index 00000000000..512d58f6801 --- /dev/null +++ b/src/attributeutils/src/Shared/AttributeValue.d.ts @@ -0,0 +1,18 @@ +import { Signal } from '@quenty/signal'; +import { ValueObjectLike } from '@quenty/valueobject'; + +interface AttributeValue extends ValueObjectLike { + Changed: Signal; + Destroy(): void; +} + +interface AttributeValueConstructor { + readonly ClassName: 'AttributeValue'; + new ( + object: Instance, + attributeName: string, + defaultValue?: T + ): AttributeValue; +} + +export const AttributeValue: AttributeValueConstructor; diff --git a/src/attributeutils/src/Shared/EncodedAttributeValue.d.ts b/src/attributeutils/src/Shared/EncodedAttributeValue.d.ts new file mode 100644 index 00000000000..6a924ed6bdc --- /dev/null +++ b/src/attributeutils/src/Shared/EncodedAttributeValue.d.ts @@ -0,0 +1,20 @@ +import { ValueObjectLike } from '@quenty/valueobject'; +import { Signal } from '@quenty/signal'; + +interface EncodedAttributeValue extends ValueObjectLike { + Changed: Signal; + Destroy(): void; +} + +interface EncodedAttributeValueConstructor { + readonly ClassName: 'EncodedAttributeValue'; + new ( + object: Instance, + attributeName: string, + encode: (value: T) => string, + decode: (value: string) => T, + defaultValue?: T + ): EncodedAttributeValue; +} + +export const EncodedAttributeValue: EncodedAttributeValueConstructor; diff --git a/src/attributeutils/src/Shared/JSONAttributeValue.d.ts b/src/attributeutils/src/Shared/JSONAttributeValue.d.ts new file mode 100644 index 00000000000..b2ccc10c054 --- /dev/null +++ b/src/attributeutils/src/Shared/JSONAttributeValue.d.ts @@ -0,0 +1,14 @@ +import { EncodedAttributeValue } from './EncodedAttributeValue'; + +interface JSONAttributeValue extends EncodedAttributeValue {} + +interface JSONAttributeValueConstructor { + readonly ClassName: 'JSONAttributeValue'; + new ( + object: Instance, + attributeName: string, + defaultValue?: T + ): JSONAttributeValue; +} + +export const JSONAttributeValue: JSONAttributeValueConstructor; diff --git a/src/attributeutils/src/Shared/RxAttributeUtils.d.ts b/src/attributeutils/src/Shared/RxAttributeUtils.d.ts new file mode 100644 index 00000000000..014a465fd66 --- /dev/null +++ b/src/attributeutils/src/Shared/RxAttributeUtils.d.ts @@ -0,0 +1,34 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxAttributeUtils { + function observeAttribute( + instance: Instance, + attributeName: string, + defaultValue?: T + ): Observable; + function observeAttributeKeysBrio( + instance: Instance + ): Observable>; + function observeAttributeKeys(instance: Instance): Observable; + + function observeAttributeBrio( + instance: Instance, + attributeName: string + ): Observable>; + function observeAttributeBrio( + instance: Instance, + attributeName: string, + predicate?: (value: T) => value is NonNullable + ): Observable>>; + function observeAttributeBrio( + instance: Instance, + attributeName: string, + predicate?: (value: T) => value is Exclude> + ): Observable>>>; + function observeAttributeBrio( + instance: Instance, + attributeName: string, + predicate: (value: T) => boolean + ): Observable>; +} diff --git a/src/avatareditorutils/index.d.ts b/src/avatareditorutils/index.d.ts new file mode 100644 index 00000000000..f6352bada84 --- /dev/null +++ b/src/avatareditorutils/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/AvatarEditorInventory'; +export * from './src/Client/AvatarEditorInventoryServiceClient'; +export * from './src/Shared/AvatarEditorUtils'; +export * from './src/Shared/Cache/CatalogSearchServiceCache'; diff --git a/src/avatareditorutils/src/Client/AvatarEditorInventory.d.ts b/src/avatareditorutils/src/Client/AvatarEditorInventory.d.ts new file mode 100644 index 00000000000..347a1da2dc1 --- /dev/null +++ b/src/avatareditorutils/src/Client/AvatarEditorInventory.d.ts @@ -0,0 +1,21 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +interface AvatarEditorInventory extends BaseObject { + PromiseProcessPages(inventoryPages: InventoryPages): Promise; + IsAssetIdInInventory(assetId: number): boolean; + ObserveAssetIdInInventory(assetId: number): Observable<{ + AssetId: number; + AssetType: string; + Created: string; + Name: string; + }>; +} + +interface AvatarEditorInventoryConstructor { + readonly ClassName: 'AvatarEditorInventory'; + new (): AvatarEditorInventory; +} + +export const AvatarEditorInventory: AvatarEditorInventoryConstructor; diff --git a/src/avatareditorutils/src/Client/AvatarEditorInventoryServiceClient.d.ts b/src/avatareditorutils/src/Client/AvatarEditorInventoryServiceClient.d.ts new file mode 100644 index 00000000000..ac6459b1496 --- /dev/null +++ b/src/avatareditorutils/src/Client/AvatarEditorInventoryServiceClient.d.ts @@ -0,0 +1,18 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface AvatarEditorInventoryServiceClient { + readonly ServiceName: 'AvatarEditorInventoryServiceClient'; + Init(serviceBag: ServiceBag): void; + PromiseInventoryPages( + avatarAssetType: Enum.AvatarAssetType + ): Promise; + PromiseInventoryForAvatarAssetType( + avatarAssetType: Enum.AvatarAssetType + ): Promise; + IsInventoryAccessAllowed(): boolean; + ObserveIsInventoryAccessAllowed(): Observable; + PromiseEnsureAccess(): Promise; + Destroy(): void; +} diff --git a/src/avatareditorutils/src/Shared/AvatarEditorUtils.d.ts b/src/avatareditorutils/src/Shared/AvatarEditorUtils.d.ts new file mode 100644 index 00000000000..05c6ccd8eae --- /dev/null +++ b/src/avatareditorutils/src/Shared/AvatarEditorUtils.d.ts @@ -0,0 +1,72 @@ +import { Promise } from '@quenty/promise'; + +export type ToItemDetails = + T extends Enum.AvatarItemType.Asset + ? AssetItemDetails + : T extends Enum.AvatarItemType.Bundle + ? BundleItemDetails + : ItemDetails; + +export namespace AvatarEditorUtils { + function promiseItemDetails( + itemId: number, + itemType: T + ): Promise>; + function promiseBatchItemDetails( + itemIds: number[], + itemType: T + ): Promise[]>; + function promiseCheckApplyDefaultClothing( + humanoidDescription: HumanoidDescription + ): Promise; + function promiseConformToAvatarRules( + humanoidDescription: HumanoidDescription + ): Promise; + function promiseAvatarRules(): Promise; + function promiseIsFavorited( + itemId: number, + itemType: Enum.AvatarItemType + ): Promise; + function promiseSearchCatalog( + catalogSearchParams: CatalogSearchParams + ): Promise; + function promiseInventoryPages( + assetTypes: Enum.AvatarAssetType[] + ): Promise; + function promiseOutfitPages( + outfitSource: Enum.OutfitSource, + outfitType: Enum.OutfitType + ): Promise; + function promiseRecommendedAssets( + assetType: Enum.AvatarAssetType, + contextAssetId?: number + ): Promise; + function promiseRecommendedBundles( + bundleId: number + ): Promise; + function promptAllowInventoryReadAccess(): Promise; + function promptCreateOutfit( + outfit: HumanoidDescription, + rigType: Enum.HumanoidRigType + ): Promise; + function promptDeleteOutfit( + outfitId: number + ): Promise; + function promptRenameOutfit( + outfitId: number + ): Promise; + function promptSaveAvatar( + humanoidDescription: HumanoidDescription, + rigType: Enum.HumanoidRigType + ): Promise; + function promptSetFavorite( + itemId: number, + itemType: Enum.AvatarItemType, + shouldFavorite: boolean + ): Promise; + function promptUpdateOutfit( + outfitId: number, + updatedOutfit: HumanoidDescription, + rigType: Enum.HumanoidRigType + ): Promise; +} diff --git a/src/avatareditorutils/src/Shared/Cache/CatalogSearchServiceCache.d.ts b/src/avatareditorutils/src/Shared/Cache/CatalogSearchServiceCache.d.ts new file mode 100644 index 00000000000..ea887d9da7e --- /dev/null +++ b/src/avatareditorutils/src/Shared/Cache/CatalogSearchServiceCache.d.ts @@ -0,0 +1,17 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { ToItemDetails } from '../AvatarEditorUtils'; +import { PagesProxy } from '@quenty/pagesutils'; + +export interface CatalogSearchServiceCache { + readonly ServiceName: 'CatalogSearchServiceCache'; + Init(serviceBag: ServiceBag): void; + PromiseAvatarRules(): Promise; + PromiseItemDetails( + assetId: number, + avatarItemType: T + ): Promise[]>; + PromiseSearchCatalog( + params: CatalogSearchParams + ): Promise>; +} diff --git a/src/axisangleutils/index.d.ts b/src/axisangleutils/index.d.ts new file mode 100644 index 00000000000..61186a962d6 --- /dev/null +++ b/src/axisangleutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AxisAngleUtils'; diff --git a/src/axisangleutils/src/Shared/AxisAngleUtils.d.ts b/src/axisangleutils/src/Shared/AxisAngleUtils.d.ts new file mode 100644 index 00000000000..e80ed55b851 --- /dev/null +++ b/src/axisangleutils/src/Shared/AxisAngleUtils.d.ts @@ -0,0 +1,6 @@ +export namespace AxisAngleUtils { + function toCFrame(axisAngle: Vector3, position?: Vector3): CFrame; + function fromCFrame( + cframe: CFrame + ): LuaTuple<[axisAngle: Vector3, position: Vector3]>; +} diff --git a/src/badgeutils/index.d.ts b/src/badgeutils/index.d.ts new file mode 100644 index 00000000000..008b2339661 --- /dev/null +++ b/src/badgeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/BadgeUtils'; diff --git a/src/badgeutils/src/Shared/BadgeUtils.d.ts b/src/badgeutils/src/Shared/BadgeUtils.d.ts new file mode 100644 index 00000000000..52e3c90a0cc --- /dev/null +++ b/src/badgeutils/src/Shared/BadgeUtils.d.ts @@ -0,0 +1,8 @@ +export namespace BadgeUtils { + function promiseAwardBadge(player: Player, badgeId: number): Promise; + function promiseBadgeInfo(badgeId: number): Promise; + function promiseUserHasBadge( + userId: number, + badgeId: number + ): Promise; +} diff --git a/src/baseobject/index.d.ts b/src/baseobject/index.d.ts new file mode 100644 index 00000000000..18e9bdf6256 --- /dev/null +++ b/src/baseobject/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/BaseObject'; diff --git a/src/baseobject/src/Shared/BaseObject.d.ts b/src/baseobject/src/Shared/BaseObject.d.ts new file mode 100644 index 00000000000..f859dd9ce6e --- /dev/null +++ b/src/baseobject/src/Shared/BaseObject.d.ts @@ -0,0 +1,9 @@ +import { Maid } from '@quenty/maid'; + +export class BaseObject { + public static readonly ClassName: 'BaseObject'; + protected _obj: T; + protected _maid: Maid; + constructor(instance?: T); + public Destroy(): void; +} diff --git a/src/basicpane/index.d.ts b/src/basicpane/index.d.ts new file mode 100644 index 00000000000..8ecad9342a2 --- /dev/null +++ b/src/basicpane/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/BasicPaneUtils'; +export * from './src/Shared/BasicPane'; diff --git a/src/basicpane/src/Shared/BasicPane.d.ts b/src/basicpane/src/Shared/BasicPane.d.ts new file mode 100644 index 00000000000..745c7e241a6 --- /dev/null +++ b/src/basicpane/src/Shared/BasicPane.d.ts @@ -0,0 +1,22 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +interface BasicPane { + SetVisible(isVisible: boolean, doNotAnimate?: boolean): void; + ObserveVisible(): Observable; + ObserveVisibleBrio(): Observable>; + Show(doNotAnimate?: boolean): void; + Hide(doNotAnimate?: boolean): void; + Toggle(doNotAnimate?: boolean): void; + IsVisible(): boolean; + Destroy(): void; +} + +interface BasicPaneConstructor { + readonly ClassName: 'BasicPane'; + new (gui?: GuiObject): BasicPane; + + isBasicPane: (value: unknown) => value is BasicPane; +} + +export const BasicPane: BasicPaneConstructor; diff --git a/src/basicpane/src/Shared/BasicPaneUtils.d.ts b/src/basicpane/src/Shared/BasicPaneUtils.d.ts new file mode 100644 index 00000000000..f54b32d5185 --- /dev/null +++ b/src/basicpane/src/Shared/BasicPaneUtils.d.ts @@ -0,0 +1,14 @@ +import { Observable, Operator, Rx } from '@quenty/rx'; +import { BasicPane } from './BasicPane'; +import { Maid } from '@quenty/maid'; +import { Brio } from '@quenty/brio'; + +export namespace BasicPaneUtils { + function observeVisible(basicPane: BasicPane): Observable; + function whenVisibleBrio( + createBasicPane: (maid: Maid) => BasicPane + ): Operator>; + function observePercentVisible(basicPane: BasicPane): Observable; + const toTransparency: typeof Rx.map; + function observeShow(basicPane: BasicPane): Observable; +} diff --git a/src/bezierutils/index.d.ts b/src/bezierutils/index.d.ts new file mode 100644 index 00000000000..57bcdd80d28 --- /dev/null +++ b/src/bezierutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/BezierUtils'; diff --git a/src/bezierutils/src/Shared/BezierUtils.d.ts b/src/bezierutils/src/Shared/BezierUtils.d.ts new file mode 100644 index 00000000000..40a62691fd6 --- /dev/null +++ b/src/bezierutils/src/Shared/BezierUtils.d.ts @@ -0,0 +1,8 @@ +export namespace BezierUtils { + function createBezierFactory( + p1x: number, + p1y: number, + p2x: number, + p2y: number + ): (aX: number) => number; +} diff --git a/src/binarysearch/index.d.ts b/src/binarysearch/index.d.ts new file mode 100644 index 00000000000..f2af1abe238 --- /dev/null +++ b/src/binarysearch/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/BinarySearchUtils'; diff --git a/src/binarysearch/src/Shared/BinarySearchUtils.d.ts b/src/binarysearch/src/Shared/BinarySearchUtils.d.ts new file mode 100644 index 00000000000..9b92ef66c59 --- /dev/null +++ b/src/binarysearch/src/Shared/BinarySearchUtils.d.ts @@ -0,0 +1,16 @@ +export namespace BinarySearchUtils { + function spanSearch( + list: number[], + t: number + ): LuaTuple<[number | undefined, number | undefined]>; + function spanSearchNodes( + list: V[], + index: keyof V, + t: number + ): LuaTuple<[unknown | undefined, unknown | undefined]>; + function spanSearchAnything( + n: number, + indexFunc: (index: number) => number, + t: number + ): LuaTuple<[number | undefined, number | undefined]>; +} diff --git a/src/binder/index.d.ts b/src/binder/index.d.ts new file mode 100644 index 00000000000..c6a65f3ae31 --- /dev/null +++ b/src/binder/index.d.ts @@ -0,0 +1,9 @@ +export * from './src/Shared/Binder'; +export * from './src/Shared/BinderGroup'; +export * from './src/Shared/BinderGroupProvider'; +export * from './src/Shared/BinderProvider'; +export * from './src/Shared/BinderUtils'; +export * from './src/Shared/Promise/promiseBoundClass'; +export * from './src/Shared/Trackers/BoundAncestorTracker'; +export * from './src/Shared/Trackers/BoundParentTracker'; +export * from './src/Shared/Collection/BoundChildCollection'; diff --git a/src/binder/src/Shared/Binder.d.ts b/src/binder/src/Shared/Binder.d.ts new file mode 100644 index 00000000000..766fc82671f --- /dev/null +++ b/src/binder/src/Shared/Binder.d.ts @@ -0,0 +1,54 @@ +import { Signal } from '@quenty/signal'; +import { Brio } from '@quenty/brio'; +import { CancelToken } from '@quenty/canceltoken'; +import { Observable } from '@quenty/rx'; +import { Promise } from '@quenty/promise'; + +interface Static { + readonly ClassName: 'Binder'; +} + +export interface Binder extends Static { + readonly ServiceName: string; + Init(): void; + Start(): void; + GetTag(): string; + GetConstructor(): new (instance: Instance, ...args: unknown[]) => T; + ObserveAllBrio(): Observable>; + ObserveBrio(instance: Instance): Observable>; + ObserveInstance( + instance: Instance, + callback: (boundClass: T) => void + ): () => void; + GetClassAddedSignal(): Signal; + GetClassRemovingSignal(): Signal; + GetClassRemovedSignal(): Signal; + GetAll(): T[]; + GetAllSet(): ReadonlyMap; + Bind(instance: Instance): T | undefined; + Tag(instance: Instance): void; + HasTag(instance: Instance): boolean; + Untag(instance: Instance): void; + Unbind(instance: Instance): void; + BindClient(instance: Instance): T | undefined; + UnbindClient(instance: Instance): void; + Get(instance: Instance): T | undefined; + Promise(instance: Instance, cancelToken?: CancelToken): Promise; + Create(className?: string): Instance; + Observe(instance: Instance): Observable; + Destroy(): void; +} + +interface BinderConstructor extends Static { + isBinder: (value: unknown) => value is Binder; + + new ( + tagName: string, + constructor: new (instance: I, ...args: TArgs) => TClass, + ...args: TArgs + ): Binder; +} + +export const Binder: BinderConstructor; + +export {}; diff --git a/src/binder/src/Shared/BinderGroup.d.ts b/src/binder/src/Shared/BinderGroup.d.ts new file mode 100644 index 00000000000..3349a5e54c4 --- /dev/null +++ b/src/binder/src/Shared/BinderGroup.d.ts @@ -0,0 +1,20 @@ +import { Signal } from '@quenty/signal'; +import { Binder } from './Binder'; + +interface BinderGroup { + BinderAdded: Signal>; + + AddList(binders: { [K in keyof T]: Binder }): void; + Add(binder: Binder): void; + GetBinders(): Binder[]; +} + +interface BinderGroupConstructor { + readonly ClassName: 'BinderGroup'; + new ( + binders: { [K in keyof T]: Binder }, + validateConstructor?: (constructor: unknown) => boolean + ): BinderGroup; +} + +export const BinderGroup: BinderGroupConstructor; diff --git a/src/binder/src/Shared/BinderGroupProvider.d.ts b/src/binder/src/Shared/BinderGroupProvider.d.ts new file mode 100644 index 00000000000..025cd57d0ce --- /dev/null +++ b/src/binder/src/Shared/BinderGroupProvider.d.ts @@ -0,0 +1,23 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { BinderGroup } from './BinderGroup'; + +interface BinderGroupProvider { + Init(serviceBag: ServiceBag | undefined): void; + Start(): void; + Get(groupName: string): BinderGroup | undefined; + Add(groupName: string, binderGroup: BinderGroup): void; + Destroy(): void; +} + +interface BinderGroupProviderConstructor { + readonly ClassName: 'BinderGroupProvider'; + readonly ServiceName: 'BinderGroupProvider'; + new ( + initMethod: ( + this: BinderGroupProvider, + serviceBag: ServiceBag | undefined + ) => void + ): BinderGroupProvider; +} + +export const BinderGroupProvider: BinderGroupProviderConstructor; diff --git a/src/binder/src/Shared/BinderProvider.d.ts b/src/binder/src/Shared/BinderProvider.d.ts new file mode 100644 index 00000000000..8022b2f8467 --- /dev/null +++ b/src/binder/src/Shared/BinderProvider.d.ts @@ -0,0 +1,32 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from './Binder'; + +type ToBinderMap | unknown> = { + [K in keyof T]: Binder; +}; + +type BinderProvider | unknown> = + ToBinderMap & { + PromiseBinder(binderName: string): Promise>; + Init(serviceBag: ServiceBag): void; + PromiseBindersAdded(): Promise; + PromiseBindersStarted(): Promise; + Start(): void; + Get(tagName: string): Binder | undefined; + Add(binder: Binder): void; + Destroy(): void; + }; + +interface BinderProviderConstructor { + readonly ClassName: 'BinderProvider'; + readonly ServiceName: 'BinderProvider'; + new | unknown>( + serviceName: string, + initMethod: (self: BinderProvider, serviceBag: ServiceBag) => void + ): BinderProvider; + + isBinderProvider: (value: unknown) => value is BinderProvider; +} + +export const BinderProvider: BinderProviderConstructor; diff --git a/src/binder/src/Shared/BinderUtils.d.ts b/src/binder/src/Shared/BinderUtils.d.ts new file mode 100644 index 00000000000..a49b6e0f1ea --- /dev/null +++ b/src/binder/src/Shared/BinderUtils.d.ts @@ -0,0 +1,27 @@ +import { Binder } from './Binder'; + +export namespace BinderUtils { + function findFirstAncestor( + binder: Binder, + child: Instance + ): T | undefined; + function findFirstChild( + binder: Binder, + parent: Instance + ): T | undefined; + function getChildren(binder: Binder, parent: Instance): T[]; + function mapBinderListToTable( + bindersList: Map> + ): Map>; + function getMappedFromList(tagsMap: Map>): unknown[]; + function getChildrenOfBinders( + bindersList: Binder[], + parent: Instance + ): T[]; + function getLinkedChildren( + binder: Binder, + linkName: string, + parent: Instance + ): T[]; + function getDescendants(binder: Binder, parent: Instance): T[]; +} diff --git a/src/binder/src/Shared/Collection/BoundChildCollection.d.ts b/src/binder/src/Shared/Collection/BoundChildCollection.d.ts new file mode 100644 index 00000000000..3ad5a505026 --- /dev/null +++ b/src/binder/src/Shared/Collection/BoundChildCollection.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '../Binder'; +import { Signal } from '@quenty/signal'; + +interface BoundChildCollection extends BaseObject { + ClassAdded: Signal; + ClassRemoved: Signal; + + HasClass(classObj: T): boolean; + GetSize(): number; + GetSet(): ReadonlyMap; + GetClasses(): T[]; +} + +interface BoundChildCollectionConstructor { + readonly ClassName: 'BoundChildCollection'; + new (binder: Binder): BoundChildCollection; + + readonly ExtraPixels: 2; +} + +export const BoundChildCollection: BoundChildCollectionConstructor; diff --git a/src/binder/src/Shared/Promise/promiseBoundClass.d.ts b/src/binder/src/Shared/Promise/promiseBoundClass.d.ts new file mode 100644 index 00000000000..e806f8f8c92 --- /dev/null +++ b/src/binder/src/Shared/Promise/promiseBoundClass.d.ts @@ -0,0 +1,9 @@ +import { CancelToken } from '@quenty/canceltoken'; +import { Binder } from '../Binder'; +import { Promise } from '@quenty/promise'; + +export const promiseBoundClass: ( + binder: Binder, + inst: Instance, + cancelToken?: CancelToken +) => Promise; diff --git a/src/binder/src/Shared/Trackers/BoundAncestorTracker.d.ts b/src/binder/src/Shared/Trackers/BoundAncestorTracker.d.ts new file mode 100644 index 00000000000..0eea15fc983 --- /dev/null +++ b/src/binder/src/Shared/Trackers/BoundAncestorTracker.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '../Binder'; +import { ValueObject } from '@quenty/valueobject'; + +interface BoundAncestorTracker extends BaseObject { + Class: ValueObject; +} + +interface BoundAncestorTrackerConstructor { + readonly ClassName: 'BoundAncestorTracker'; + new (binder: Binder, child: Instance): BoundAncestorTracker; +} + +export const BoundAncestorTracker: BoundAncestorTrackerConstructor; diff --git a/src/binder/src/Shared/Trackers/BoundParentTracker.d.ts b/src/binder/src/Shared/Trackers/BoundParentTracker.d.ts new file mode 100644 index 00000000000..119044f1e68 --- /dev/null +++ b/src/binder/src/Shared/Trackers/BoundParentTracker.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '../Binder'; +import { ValueObject } from '@quenty/valueobject'; + +interface BoundParentTracker extends BaseObject { + Class: ValueObject; +} + +interface BoundParentTrackerConstructor { + readonly ClassName: 'BoundParentTracker'; + new (binder: Binder, child: Instance): BoundParentTracker; +} + +export const BoundParentTracker: BoundParentTrackerConstructor; diff --git a/src/bindtocloseservice/index.d.ts b/src/bindtocloseservice/index.d.ts new file mode 100644 index 00000000000..9e2b59cc64f --- /dev/null +++ b/src/bindtocloseservice/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/BindToCloseService'; diff --git a/src/bindtocloseservice/src/Server/BindToCloseService.d.ts b/src/bindtocloseservice/src/Server/BindToCloseService.d.ts new file mode 100644 index 00000000000..2dd8579a007 --- /dev/null +++ b/src/bindtocloseservice/src/Server/BindToCloseService.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface BindToCloseService { + readonly ServiceName: 'BindToCloseService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + RegisterPromiseOnCloseCallback(saveCallback: () => Promise): () => void; + Destroy(): void; +} diff --git a/src/blend/index.d.ts b/src/blend/index.d.ts new file mode 100644 index 00000000000..cd3abc8e03f --- /dev/null +++ b/src/blend/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/Blend/Blend'; +export * from './src/Shared/Blend/BlendDefaultProps'; +export * from './src/Shared/Blend/SpringObject'; diff --git a/src/blend/src/Shared/Blend/Blend.d.ts b/src/blend/src/Shared/Blend/Blend.d.ts new file mode 100644 index 00000000000..3f81e893ebe --- /dev/null +++ b/src/blend/src/Shared/Blend/Blend.d.ts @@ -0,0 +1,111 @@ +import { Brio } from '@quenty/brio'; +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { CheckType, ValueObject } from '@quenty/valueobject'; +import { SpringObject } from './SpringObject'; +import { Signal, SignalLike } from '@quenty/signal'; + +export type ToPropertyObservableArgument = + | Observable + | Promise + | { + Observe(): T; + } + | ValueBase; + +type BlendProps = { + [K in keyof WritableInstanceProperties]?: + | WritableInstanceProperties[K] + | ToPropertyObservableArgument[K]>; +} & { + __tags?: string[]; + __instance?: (instance: T) => void; + __children?: Observable[]; +}; + +export namespace Blend { + function New( + className: T + ): (props: BlendProps) => Observable; + const Tags: '__tags'; + const Instance: '__instance'; + const Children: '__children'; + function OnChange( + propertyName: keyof InstanceProperties + ): symbol; + function OnEvent( + eventName: keyof InstanceEvents + ): symbol; + function Attached( + callback: (instance: T) => void + ): symbol; + function Find( + className: T + ): ( + props: Instances[T] extends Instance ? BlendProps : never + ) => symbol; + function Single( + observable: Observable> + ): Observable>; + function mount(instance: T, props: BlendProps): Maid; + + function State( + defaultValue?: T, + checkType?: CheckType + ): ValueObject; + function Computed( + ...values: [...values: unknown[], compute: () => T] + ): Observable; + function ComputedPairs( + value: unknown, + compute: (key: unknown, value: unknown, maid: Maid) => T + ): Observable>; + function AccelTween( + source: unknown, + acceleration: unknown + ): Observable; + function Spring( + ...args: ConstructorParameters> + ): Observable>; + function toPropertyObservable( + value: ToPropertyObservableArgument + ): Observable | undefined; + function toNumberObservable( + value: number | ToPropertyObservableArgument + ): Observable; + function toEventObservable< + T extends + | Observable + | RBXScriptSignal<(...args: unknown[]) => unknown> + | Signal + >( + value: T + ): T extends Observable + ? Observable + : T extends RBXScriptSignal + ? Observable> + : T extends Signal + ? Observable + : never; + function toEventHandler< + T extends + | ((...args: unknown[]) => unknown) + | ValueBase + | SignalLike + | ValueObject + >( + value: T + ): T extends (...args: infer V) => unknown + ? (...args: V) => void + : T extends ValueBase + ? (result: unknown) => void + : T extends SignalLike + ? (result: V) => void + : T extends ValueObject + ? (result: V) => void + : never; + function Throtthled(observable: Observable): Observable; + function Shared(observable: Observable): Observable; + const Dynamic: typeof Computed; +} diff --git a/src/blend/src/Shared/Blend/BlendDefaultProps.d.ts b/src/blend/src/Shared/Blend/BlendDefaultProps.d.ts new file mode 100644 index 00000000000..d2e131035af --- /dev/null +++ b/src/blend/src/Shared/Blend/BlendDefaultProps.d.ts @@ -0,0 +1,5 @@ +export const BlendDefaultProps: { + [K in keyof Instances]?: Instances[K] extends Instance + ? Partial> + : never; +}; diff --git a/src/blend/src/Shared/Blend/SpringObject.d.ts b/src/blend/src/Shared/Blend/SpringObject.d.ts new file mode 100644 index 00000000000..f8fed1f80a8 --- /dev/null +++ b/src/blend/src/Shared/Blend/SpringObject.d.ts @@ -0,0 +1,57 @@ +import { Signal, SignalLike } from '@quenty/signal'; +import { ToPropertyObservableArgument } from './Blend'; +import { Observable } from '@quenty/rx'; +import { Promise } from '@quenty/promise'; +import { SpringClock } from '@quenty/spring'; + +interface SpringObject { + Changed: Signal; + Observe(): Observable; + ObserveRenderStepped(): Observable; + ObserveTarget(): Observable; + ObserveVelocityOnRenderStepped(): Observable; + PromiseFinished(signal?: SignalLike): Promise; + ObserveVelocityOnSignal(signal: SignalLike): Observable; + ObserveOnSignal(signal: SignalLike): Observable; + IsAnimating(): boolean; + Impulse(velocity: T): void; + SetTarget(target: T, doNotAnimate?: boolean): () => void; + SetVelocity(velocity: T): void; + SetPosition(position: T): void; + SetDamper(damper: number | ToPropertyObservableArgument): void; + SetSpeed(speed: number | ToPropertyObservableArgument): void; + SetClock(clock: SpringClock): void; + SetEpsilon(epsilon: number): void; + TimeSkip(delta: number): void; + Destroy(): void; + + Value: T; + Position: T; + p: T; + Velocity: T; + v: T; + Target: T; + t: T; + get Damper(): number; + set Damper(value: number | ToPropertyObservableArgument); + get d(): number; + set d(value: number | ToPropertyObservableArgument); + get Speed(): number; + set Speed(value: number | ToPropertyObservableArgument); + get s(): number; + set s(value: number | ToPropertyObservableArgument); + Clock: SpringClock; + Epsilon: number; +} + +interface SpringObjectConstructor { + readonly ClassName: 'SpringObject'; + new (): SpringObject; + new ( + value: T, + speed?: number | ToPropertyObservableArgument, + damper?: number | ToPropertyObservableArgument + ): SpringObject; +} + +export const SpringObject: SpringObjectConstructor; diff --git a/src/bodycolorsutils/index.d.ts b/src/bodycolorsutils/index.d.ts new file mode 100644 index 00000000000..d4c4f4d182e --- /dev/null +++ b/src/bodycolorsutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/BodyColorsDataConstants'; +export * from './src/Shared/BodyColorsDataUtils'; +export * from './src/Shared/RxBodyColorsDataUtils'; diff --git a/src/bodycolorsutils/src/Shared/BodyColorsDataConstants.d.ts b/src/bodycolorsutils/src/Shared/BodyColorsDataConstants.d.ts new file mode 100644 index 00000000000..c17c12379a4 --- /dev/null +++ b/src/bodycolorsutils/src/Shared/BodyColorsDataConstants.d.ts @@ -0,0 +1,30 @@ +import { SerializedColor3 } from '@quenty/color3serializationutils'; + +export type BodyColorsData = { + headColor: Color3 | undefined; + leftArmColor: Color3 | undefined; + leftLegColor: Color3 | undefined; + rightArmColor: Color3 | undefined; + rightLegColor: Color3 | undefined; + torsoColor: Color3 | undefined; +}; + +export type DataStoreSafeBodyColorsData = { + headColor: SerializedColor3 | undefined; + leftArmColor: SerializedColor3 | undefined; + leftLegColor: SerializedColor3 | undefined; + rightArmColor: SerializedColor3 | undefined; + rightLegColor: SerializedColor3 | undefined; + torsoColor: SerializedColor3 | undefined; +}; + +export const BodyColorsDataConstants: Readonly<{ + ATTRIBUTE_MAPPING: { + headColor: 'HeadColor'; + leftArmColor: 'LeftArmColor'; + leftLegColor: 'LeftLegColor'; + rightArmColor: 'RightArmColor'; + rightLegColor: 'RightLegColor'; + torsoColor: 'TorsoColor'; + }; +}>; diff --git a/src/bodycolorsutils/src/Shared/BodyColorsDataUtils.d.ts b/src/bodycolorsutils/src/Shared/BodyColorsDataUtils.d.ts new file mode 100644 index 00000000000..503ac95ad6f --- /dev/null +++ b/src/bodycolorsutils/src/Shared/BodyColorsDataUtils.d.ts @@ -0,0 +1,39 @@ +import { + BodyColorsData, + DataStoreSafeBodyColorsData, +} from './BodyColorsDataConstants'; + +export namespace BodyColorsDataUtils { + function createBodyColorsData(bodyColorsData: T): T; + function isBodyColorsData(value: unknown): value is BodyColorsData; + function fromUniformColor(color: Color3): BodyColorsData; + function fromBodyColors(bodyColors: BodyColors): BodyColorsData; + function isDataStoreSafeBodyColorsData( + value: unknown + ): value is DataStoreSafeBodyColorsData; + function toDataStoreSafeBodyColorsData( + bodyColorsData: BodyColorsData + ): DataStoreSafeBodyColorsData; + function fromDataStoreSafeBodyColorsData( + data: DataStoreSafeBodyColorsData + ): BodyColorsData; + function fromHumanoidDescription( + humanoidDescription: HumanoidDescription + ): BodyColorsData; + function isUniformColor(bodyColorsData: BodyColorsData): boolean; + function getUniformColor(bodyColorsData: BodyColorsData): Color3 | undefined; + function toBodyColors(bodyColorsData: BodyColorsData): BodyColors; + function applyToBodyColors( + bodyColorsData: BodyColorsData, + bodyColors: BodyColors + ): void; + function fromAttributes(instance: Instance): BodyColorsData; + function setAttributes( + instance: Instance, + bodyColorsData: BodyColorsData + ): void; + function applyToHumanoidDescription( + bodyColorsData: BodyColorsData, + humanoidDescription: HumanoidDescription + ): void; +} diff --git a/src/bodycolorsutils/src/Shared/RxBodyColorsDataUtils.d.ts b/src/bodycolorsutils/src/Shared/RxBodyColorsDataUtils.d.ts new file mode 100644 index 00000000000..6d6864fb91a --- /dev/null +++ b/src/bodycolorsutils/src/Shared/RxBodyColorsDataUtils.d.ts @@ -0,0 +1,6 @@ +import { Observable } from '@quenty/rx'; +import { BodyColorsData } from './BodyColorsDataConstants'; + +export namespace RxBodyColorsDataUtils { + function observeFromAttribute(instance: Instance): Observable; +} diff --git a/src/boundingboxutils/index.d.ts b/src/boundingboxutils/index.d.ts new file mode 100644 index 00000000000..4ce2dd301b2 --- /dev/null +++ b/src/boundingboxutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/BoundingBoxUtils'; +export * from './src/Shared/CompiledBoundingBoxUtils'; diff --git a/src/boundingboxutils/src/Shared/BoundingBoxUtils.d.ts b/src/boundingboxutils/src/Shared/BoundingBoxUtils.d.ts new file mode 100644 index 00000000000..e1fe442cec9 --- /dev/null +++ b/src/boundingboxutils/src/Shared/BoundingBoxUtils.d.ts @@ -0,0 +1,45 @@ +export interface PartLike { + CFrame: CFrame; + Size: Vector3; +} + +export namespace BoundingBoxUtils { + function getPartsBoundingBox( + parts: PartLike[], + relativeTo?: CFrame + ): LuaTuple<[size: Vector3, position: Vector3]>; + function clampPointToBoundingBox( + cframe: CFrame, + size: Vector3, + point: Vector3 + ): LuaTuple<[clampedPoint: Vector3, centerPoint: Vector3]>; + function pushPointToLieOnBoundingBox( + cframe: CFrame, + size: Vector3, + point: Vector3 + ): LuaTuple<[pushedPoint: Vector3, centerPoint: Vector3]>; + function getChildrenBoundingBox( + parent: Instance, + relativeTo?: CFrame + ): LuaTuple<[size?: Vector3, position?: Vector3]>; + function axisAlignedBoxSize(cframe: CFrame, size: Vector3): Vector3; + function getBoundingBox( + data: PartLike[], + relativeTo?: CFrame + ): LuaTuple<[size?: Vector3, position?: Vector3]>; + function inBoundingBox( + cframe: CFrame, + size: Vector3, + testPosition: Vector3 + ): boolean; + function inCylinderBoundingBox( + cframe: CFrame, + Size: Vector3, + testPosition: Vector3 + ): boolean; + function inBallBoundingBox( + cframe: CFrame, + size: Vector3, + testPosition: Vector3 + ): boolean; +} diff --git a/src/boundingboxutils/src/Shared/CompiledBoundingBoxUtils.d.ts b/src/boundingboxutils/src/Shared/CompiledBoundingBoxUtils.d.ts new file mode 100644 index 00000000000..793857895e7 --- /dev/null +++ b/src/boundingboxutils/src/Shared/CompiledBoundingBoxUtils.d.ts @@ -0,0 +1,4 @@ +export namespace CompiledBoundingBoxUtils { + function compileBBox(cframe: CFrame, size: Vector3): CFrame; + function testPointBBox(point: Vector3, bbox: CFrame): boolean; +} diff --git a/src/boundlinkutils/index.d.ts b/src/boundlinkutils/index.d.ts new file mode 100644 index 00000000000..ec6617fb286 --- /dev/null +++ b/src/boundlinkutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/BoundLinkCollection'; +export * from './src/Shared/BoundLinkUtils'; +export * from './src/Shared/promiseBoundLinkedClass'; diff --git a/src/boundlinkutils/src/Shared/BoundLinkCollection.d.ts b/src/boundlinkutils/src/Shared/BoundLinkCollection.d.ts new file mode 100644 index 00000000000..ff664611de1 --- /dev/null +++ b/src/boundlinkutils/src/Shared/BoundLinkCollection.d.ts @@ -0,0 +1,19 @@ +import { Binder } from '@quenty/binder'; + +type BoundLinkCollection = { + GetClasses(): T[]; + HasClass(value: T): boolean; + TrackParent(parent: Instance): void; + Destroy(): void; +}; + +interface BoundLinkCollectionConstructor { + readonly ClassName: 'BoundLinkCollection'; + new ( + binder: Binder, + linkName: string, + parent: Instance + ): BoundLinkCollection; +} + +export const BoundLinkCollection: BoundLinkCollectionConstructor; diff --git a/src/boundlinkutils/src/Shared/BoundLinkUtils.d.ts b/src/boundlinkutils/src/Shared/BoundLinkUtils.d.ts new file mode 100644 index 00000000000..faa51aa66e4 --- /dev/null +++ b/src/boundlinkutils/src/Shared/BoundLinkUtils.d.ts @@ -0,0 +1,39 @@ +import { Binder } from '@quenty/binder'; + +type FunctionPropertyNames = { + [K in keyof T]: T[K] extends (...args: any) => any ? K : never; +}[keyof T]; + +type FunctionPropertyType< + T, + K extends FunctionPropertyNames +> = T[K] extends (...args: any) => any ? T[K] : never; + +export namespace BoundLinkUtils { + function getLinkClass( + binder: Binder, + linkName: string, + from: Instance + ): T | undefined; + function getLinkClasses( + binder: Binder, + linkName: string, + from: Instance + ): T[]; + function getClassesForLinkValues[]>( + binders: T, + linkName: string, + from: Instance + ): (T[number] extends Binder ? U : never)[]; + function callMethodOnLinkedClasses< + T extends Binder[], + U = T[number] extends Binder ? X : never, + M extends FunctionPropertyNames = FunctionPropertyNames + >( + binders: T, + linkName: string, + from: Instance, + methodName: M, + ...args: Parameters> + ): void; +} diff --git a/src/boundlinkutils/src/Shared/promiseBoundLinkedClass.d.ts b/src/boundlinkutils/src/Shared/promiseBoundLinkedClass.d.ts new file mode 100644 index 00000000000..85f6c1ac370 --- /dev/null +++ b/src/boundlinkutils/src/Shared/promiseBoundLinkedClass.d.ts @@ -0,0 +1,7 @@ +import { Binder } from '@quenty/binder'; +import { Promise } from '@quenty/promise'; + +export const promiseBoundLinkedClass: ( + binder: Binder, + objValue: ObjectValue +) => Promise; diff --git a/src/brio/index.d.ts b/src/brio/index.d.ts new file mode 100644 index 00000000000..b8eca05255c --- /dev/null +++ b/src/brio/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/Brio'; +export * from './src/Shared/BrioUtils'; +export * from './src/Shared/RxBrioUtils'; diff --git a/src/brio/src/Shared/Brio.d.ts b/src/brio/src/Shared/Brio.d.ts new file mode 100644 index 00000000000..074c82a6d3f --- /dev/null +++ b/src/brio/src/Shared/Brio.d.ts @@ -0,0 +1,39 @@ +import { Maid } from '@quenty/maid'; +import { Signal } from '@quenty/signal'; + +type ToTuple = T extends LuaTuple + ? V + : T extends [unknown, ...unknown[]] + ? T + : [T]; + +export type Brio = { + Kill(): void; + IsDead(): boolean; + GetDiedSignal(): Signal; + ErrorIfDead(): void; + ToMaid(): Maid; + ToMaidAndValue(): LuaTuple<[Maid, ...ToTuple]>; + GetValue(): T extends [unknown, ...unknown[]] ? LuaTuple : T; + GetPackedValues(): { + n: number; + [index: number]: T; + }; + + Destroy(): void; +}; + +interface BrioConstructor { + readonly ClassName: 'Brio'; + new (): Brio; + new (): Brio; + new (value: T): Brio; + new (...values: ToTuple): Brio; + + readonly DEAD: Brio; + isBrio: (value: unknown) => value is Brio; +} + +export const Brio: BrioConstructor; + +export {}; diff --git a/src/brio/src/Shared/BrioUtils.d.ts b/src/brio/src/Shared/BrioUtils.d.ts new file mode 100644 index 00000000000..c283b1a8a1a --- /dev/null +++ b/src/brio/src/Shared/BrioUtils.d.ts @@ -0,0 +1,44 @@ +import { Brio } from './Brio'; + +type ToTuple = T extends [unknown, ...unknown[]] ? T : [T]; + +type FlattenTuples = T extends [infer Head, ...infer Tail] + ? Head extends unknown[] + ? [...Head, ...FlattenTuples] + : [Head, ...FlattenTuples] + : []; + +export namespace BrioUtils { + function clone(brio: Brio): Brio; + function aliveOnly(brios: Array>): Array>; + function firstAlive(brios: Array>): Brio | undefined; + function flatten( + brioTable: Map | T> + ): Brio>; + function first( + brios: Brio[], + ...values: ToTuple + ): Brio>; + + function withOtherValues(brio: Brio, value: T): Brio; + function withOtherValues( + brio: Brio, + ...values: ToTuple + ): Brio>; + + function extend( + brio: Brio, + ...values: U + ): Brio< + LuaTuple< + [...ToTuple, ...FlattenTuples<{ [K in keyof U]: ToTuple }>] + > + >; + function prepend(brio: Brio, ...values: ToTuple): Brio; + function merge( + brio: Brio, + otherBrio: Brio + ): Brio, ...ToTuple]>>; +} + +export {}; diff --git a/src/brio/src/Shared/RxBrioUtils.d.ts b/src/brio/src/Shared/RxBrioUtils.d.ts new file mode 100644 index 00000000000..0494383e554 --- /dev/null +++ b/src/brio/src/Shared/RxBrioUtils.d.ts @@ -0,0 +1,123 @@ +import { Maid } from '@quenty/maid'; +import { Observable, Operator } from '../../../rx'; +import { Brio } from './Brio'; + +type ToTuple = T extends [unknown, ...unknown[]] ? T : [T]; + +type FlattenValues> = { + [K in keyof T]: T[K] extends Observable> + ? V | undefined + : T[K] extends Observable + ? V | undefined + : T[K]; +}; + +export namespace RxBrioUtils { + function ofBrio(callback: ((maid: Maid) => T) | T): Observable>; + function toBrio(): ( + source: Observable | T> + ) => Observable>; + function of(...values: T): Observable>; + function completeOnDeath( + brio: Brio, + observable: Observable + ): Observable; + function emitWhileAllDead( + valueToEmitWhileAllDead: T + ): (source: Observable>) => Observable>; + function reduceToAliveList( + selectFromBrio?: (value: T) => U + ): (source: Observable>) => Observable>; + function reemitLastBrioOnDeath(): ( + source: Observable> + ) => Observable>; + function where( + predicate: (value: T) => value is NonNullable + ): Operator, Brio>>; + function where( + predicate: (value: T) => value is Exclude> + ): Operator, Brio>>>; + function where( + predicate: (value: T) => boolean + ): Operator, Brio>; + const filter: typeof where; + function combineLatest< + T extends Record< + string | number, + Observable> | Observable | unknown + > + >(observables: T): Observable>>; + function flatCombineLatestBrio< + T extends Record< + string | number, + Observable> | Observable | unknown + > + >( + observables: T, + filter?: (value: FlattenValues) => boolean + ): Observable>>; + function flatMap( + project: (value: T) => Observable + ): (source: Observable>) => Observable; + function flatMapBrio, TProject>( + project: ( + ...values: TBrio extends Brio ? ToTuple : [never] + ) => Observable + ): Operator< + TBrio, + TProject extends Brio ? TProject : Brio + >; + function switchMap( + project: (value: T) => Observable + ): (source: Observable>) => Observable; + function switchMapBrio( + project: (value: T) => Observable | Observable> + ): (source: Observable>) => Observable>; + function flatCombineLatest( + observables: Record> | Observable | T> + ): Observable>; + function mapBrio, TProject>( + project: (value: TBrio) => Observable + ): (brio: TBrio) => Observable; + function prepend( + ...values: T[] + ): (source: Observable>) => Observable>; + function extend( + ...values: T[] + ): (source: Observable>) => Observable>; + function map( + project: (...args: ToTuple) => U + ): (source: Observable>) => Observable>; + function mapBrioBrio( + project: (value: S) => Observable | Observable> + ): (brio: Brio) => Observable>; + function toEmitOnDeathObservable( + brio: Brio | T, + emitOnDeathValue: U + ): Observable; + function mapBrioToEmitOnDeathObservable( + emitOnDeathValue: U + ): (brio: Brio | T) => Observable; + function emitOnDeath( + emitOnDeathValue: U + ): (source: Observable | T>) => Observable; + function flattenToValueAndNil( + source: Observable | T> + ): Observable; + function onlyLastBrioSurvives(): ( + source: Observable> + ) => Observable>; + function switchToBrio( + predicate: (value: T) => value is NonNullable + ): (source: Observable>) => Observable>>; + function switchToBrio( + predicate: (value: T) => value is Exclude> + ): ( + source: Observable> + ) => Observable>>>; + function switchToBrio( + predicate?: (value: T) => boolean + ): (source: Observable>) => Observable>; +} + +export {}; diff --git a/src/buttondragmodel/index.d.ts b/src/buttondragmodel/index.d.ts new file mode 100644 index 00000000000..81e1d30e720 --- /dev/null +++ b/src/buttondragmodel/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/ButtonDragModel'; diff --git a/src/buttondragmodel/src/Client/ButtonDragModel.d.ts b/src/buttondragmodel/src/Client/ButtonDragModel.d.ts new file mode 100644 index 00000000000..da9da269eea --- /dev/null +++ b/src/buttondragmodel/src/Client/ButtonDragModel.d.ts @@ -0,0 +1,25 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface ButtonDragModel extends BaseObject { + DragPositionChanged: Signal; + IsDraggingChanged: Signal; + IsPressed(): boolean; + ObserveIsPressed(): Observable; + ObserveIsPressedBrio(): Observable>; + ObserveDragDelta(): Observable; + GetDragDelta(): Vector2 | undefined; + GetDragPosition(): Vector2 | undefined; + ObserveDragPosition(): Observable; + SetClampWithinButton(clampWithinButton: boolean): void; + SetButton(button: GuiButton): () => void; +} + +interface ButtonDragModelConstructor { + readonly ClassName: 'ButtonDragModel'; + new (initialButton?: GuiButton): ButtonDragModel; +} + +export const ButtonDragModel: ButtonDragModelConstructor; diff --git a/src/buttonhighlightmodel/index.d.ts b/src/buttonhighlightmodel/index.d.ts new file mode 100644 index 00000000000..4280fc003d9 --- /dev/null +++ b/src/buttonhighlightmodel/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/ButtonHighlightModel'; +export * from './src/Client/HandleHighlightModel'; diff --git a/src/buttonhighlightmodel/src/Client/ButtonHighlightModel.d.ts b/src/buttonhighlightmodel/src/Client/ButtonHighlightModel.d.ts new file mode 100644 index 00000000000..18dc87c2527 --- /dev/null +++ b/src/buttonhighlightmodel/src/Client/ButtonHighlightModel.d.ts @@ -0,0 +1,48 @@ +import { AccelTween } from '@quenty/acceltween'; +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface ButtonHighlightModel extends BaseObject { + InteractionEnabledChanged: Signal; + IsSelectedChanged: Signal; + IsMouseOrTouchOverChanged: Signal; + IsHighlightedChanged: Signal; + IsPressedChanged: Signal; + SetButton(button: GuiObject | undefined): void; + IsPressed(): boolean; + ObserveIsPressed(): Observable; + ObservePercentPressed(acceleration?: number): Observable; + ObservePercentPressedTarget(): Observable; + IsHighlighted(): boolean; + ObserveIsHighlighted(): Observable; + ObservePercentHighlightedTarget(): Observable; + ObservePercentHighlighted(acceleration?: number): Observable; + IsSelected(): boolean; + ObserveIsSelected(): Observable; + IsMouseOrTouchOver(): boolean; + ObserveIsMouseOrTouchOver(): Observable; + SetIsChoosen(isChoosen: boolean, doNotAnimate?: boolean): void; + IsChoosen(): boolean; + ObserveIsChoosen(): Observable; + ObservePercentChoosenTarget(): Observable; + ObservePercentChoosen(acceleration?: number): Observable; + SetInteractionEnabled(interactionEnabled: boolean): void; + IsInteractionEnabled(): boolean; + ObserveIsInteractionEnabled(): Observable; + SetKeyDown(isKeyDown: boolean, doNotAnimate?: boolean): void; +} + +interface ButtonHighlightModelConstructor { + readonly ClassName: 'ButtonHighlightModel'; + new ( + button?: GuiObject, + onUpdate?: ( + percentHighlighted: AccelTween, + percentChoosen: AccelTween, + percentPressed: AccelTween + ) => boolean + ): ButtonHighlightModel; +} + +export const ButtonHighlightModel: ButtonHighlightModelConstructor; diff --git a/src/buttonhighlightmodel/src/Client/HandleHighlightModel.d.ts b/src/buttonhighlightmodel/src/Client/HandleHighlightModel.d.ts new file mode 100644 index 00000000000..f87b167f810 --- /dev/null +++ b/src/buttonhighlightmodel/src/Client/HandleHighlightModel.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { ValueObject } from '@quenty/valueobject'; + +interface HandleHighlightModel extends BaseObject { + IsMouseOver: ValueObject; + IsMouseDown: ValueObject; + IsHighlighted: ValueObject; + SetHandle(handle: HandleAdornment): void; + ObservePercentPressed(): Observable; + ObservePercentHighlighted(): Observable; + ObservePercentHighlightedTarget(): Observable; +} + +interface HandleHighlightModelConstructor { + readonly ClassName: 'HandleHighlightModel'; + new (parent?: Instance): HandleHighlightModel; +} + +export const HandleHighlightModel: HandleHighlightModelConstructor; diff --git a/src/buttonutils/index.d.ts b/src/buttonutils/index.d.ts new file mode 100644 index 00000000000..288de5c53a0 --- /dev/null +++ b/src/buttonutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ButtonUtils'; diff --git a/src/buttonutils/src/Shared/ButtonUtils.d.ts b/src/buttonutils/src/Shared/ButtonUtils.d.ts new file mode 100644 index 00000000000..d3070aab611 --- /dev/null +++ b/src/buttonutils/src/Shared/ButtonUtils.d.ts @@ -0,0 +1,3 @@ +export namespace ButtonUtils { + function getMouseOverColor(originalColor: Color3, factor: number): Color3; +} diff --git a/src/camera/index.d.ts b/src/camera/index.d.ts new file mode 100644 index 00000000000..01ce904e96b --- /dev/null +++ b/src/camera/index.d.ts @@ -0,0 +1,36 @@ +export * from './src/Client/CameraStack'; +export * from './src/Client/CameraStackService'; +export * from './src/Client/CameraState'; +export * from './src/Client/CameraUtils'; +export * from './src/Client/Controls/CameraControls'; +export * from './src/Client/Controls/CameraGamepadInputUtils'; +export * from './src/Client/Controls/GamepadRotateModel'; +export * from './src/Client/Effects/CameraEffectUtils'; +export * from './src/Client/Effects/CustomCameraEffect'; +export * from './src/Client/Effects/DefaultCamera'; +export * from './src/Client/Effects/FadeBetween/FadeBetweenCamera'; +export * from './src/Client/Effects/FadeBetween/FadeBetweenCamera2'; +export * from './src/Client/Effects/FadeBetween/FadeBetweenCamera3'; +export * from './src/Client/Effects/FadeBetween/FadeBetweenCamera4'; +export * from './src/Client/Effects/FadingCamera'; +export * from './src/Client/Effects/HeartbeatCamera'; +export * from './src/Client/Effects/ImpulseCamera'; +export * from './src/Client/Effects/InverseFader'; +export * from './src/Client/Effects/LagPointCamera'; +export * from './src/Client/Effects/OverrideDefaultCameraToo'; +export * from './src/Client/Effects/PointCamera'; +export * from './src/Client/Effects/PushCamera'; +export * from './src/Client/Effects/RotatedCamera'; +export * from './src/Client/Effects/SmoothPositionCamera'; +export * from './src/Client/Effects/SmoothRotatedCamera'; +export * from './src/Client/Effects/SmoothZoomedCamera'; +export * from './src/Client/Effects/SummedCamera'; +export * from './src/Client/Effects/TrackCamera'; +export * from './src/Client/Effects/XZPlaneLockCamera'; +export * from './src/Client/Effects/ZoomedCamera'; +export * from './src/Client/Input/CameraInputUtils'; +export * from './src/Client/Input/CameraTouchInputUtils'; +export * from './src/Client/Utility/CameraFrame'; +export * from './src/Client/Utility/CameraStateTweener'; +export * from './src/Client/Utility/CameraSubjectUtils'; +export * from './src/Client/Utility/FieldOfViewUtils'; diff --git a/src/camera/src/Client/CameraStack.d.ts b/src/camera/src/Client/CameraStack.d.ts new file mode 100644 index 00000000000..ea471c52f9b --- /dev/null +++ b/src/camera/src/Client/CameraStack.d.ts @@ -0,0 +1,24 @@ +import { CameraState } from './CameraState'; +import { CameraEffect, CameraLike } from './Effects/CameraEffectUtils'; + +interface CameraStack { + PushDisable(): () => void; + PrintCameraStack(): void; + GetTopCamera(): CameraLike | undefined; + GetTopState(): CameraState | undefined; + GetNewStateBelow(): LuaTuple< + [customCameraEffect: CameraEffect, setState: (state: CameraState) => void] + >; + GetIndex(state: CameraLike): number | undefined; + GetStack(): CameraLike[]; + Remove(state: CameraLike): void; + Add(state: CameraLike): () => void; +} + +interface CameraStackConstructor { + readonly ClassName: 'CameraStack'; + new (): CameraStack; + isCameraStack: (value: unknown) => value is CameraStack; +} + +export const CameraStack: CameraStackConstructor; diff --git a/src/camera/src/Client/CameraStackService.d.ts b/src/camera/src/Client/CameraStackService.d.ts new file mode 100644 index 00000000000..2a6ed80e3bd --- /dev/null +++ b/src/camera/src/Client/CameraStackService.d.ts @@ -0,0 +1,30 @@ +import { CameraStack } from './CameraStack'; +import { CameraState } from './CameraState'; +import { CameraEffect, CameraLike } from './Effects/CameraEffectUtils'; +import { DefaultCamera } from './Effects/DefaultCamera'; +import { ImpulseCamera } from './Effects/ImpulseCamera'; + +export interface CameraStackService { + readonly ServiceName: 'CameraStackService'; + Init(): void; + Start(): void; + GetRenderPriority(): number; + SetDoNotUseDefaultCamera(doNotUseDefaultCamera: boolean): void; + PushDisable(): () => void; + PrintCameraStack(): void; + GetDefaultCamera(): CameraEffect; + GetImpulseCamera(): ImpulseCamera; + GetRawDefaultCamera(): DefaultCamera; + GetTopCamera(): CameraLike; + GetTopState(): CameraState | undefined; + GetNewStateBelow(): [ + cameraEffect: CameraEffect, + setState: (state: CameraState) => void + ]; + GetIndex(): number | undefined; + GetRawStack(): CameraLike[]; + GetCameraStack(): CameraStack; + Remove(state: CameraEffect): void; + Add(state: CameraEffect): void; + Destroy(): void; +} diff --git a/src/camera/src/Client/CameraState.d.ts b/src/camera/src/Client/CameraState.d.ts new file mode 100644 index 00000000000..dc41a9c8f50 --- /dev/null +++ b/src/camera/src/Client/CameraState.d.ts @@ -0,0 +1,23 @@ +import { CameraFrame } from './Utility/CameraFrame'; + +interface CameraState { + CFrame: CFrame; + Position: Vector3; + CameraFrame: CameraFrame; + CameraFrameDerivative: CameraFrame; + Velocity: Vector3; + FieldOfView: number; + + Set(camera: Camera): void; +} + +interface CameraStateConstructor { + readonly ClassName: 'CameraState'; + new ( + cameraFrame?: CameraFrame | Camera, + cameraFrameDerivative?: CameraFrame + ): CameraState; + isCameraState: (value: unknown) => value is CameraState; +} + +export const CameraState: CameraStateConstructor; diff --git a/src/camera/src/Client/CameraUtils.d.ts b/src/camera/src/Client/CameraUtils.d.ts new file mode 100644 index 00000000000..27c6558ca06 --- /dev/null +++ b/src/camera/src/Client/CameraUtils.d.ts @@ -0,0 +1,14 @@ +export namespace CameraUtils { + function getCubeoidDiameter(size: Vector3): number; + function fitBoundingBoxToCamera( + size: Vector3, + fovDeg: number, + aspectRatio: number + ): number; + function fitSphereToCamera( + radius: number, + fovDeg: number, + aspectRatio: number + ): number; + function isOnScreen(camera: Camera, position: Vector3): boolean; +} diff --git a/src/camera/src/Client/Controls/CameraControls.d.ts b/src/camera/src/Client/Controls/CameraControls.d.ts new file mode 100644 index 00000000000..143807f5cf6 --- /dev/null +++ b/src/camera/src/Client/Controls/CameraControls.d.ts @@ -0,0 +1,27 @@ +import { SmoothRotatedCamera } from '../Effects/SmoothRotatedCamera'; +import { SmoothZoomedCamera } from '../Effects/SmoothZoomedCamera'; + +interface CameraControls { + SetGamepadRotationAcceleration(acceleration: number): void; + GetKey(): string; + IsEnabled(): boolean; + Enable(): void; + Disable(): void; + BeginDrag(beginInputObject: InputObject): void; + SetZoomedCamera(zoomedCamera: SmoothZoomedCamera): this; + SetRotatedCamera(rotatedCamera: SmoothRotatedCamera): this; + SetVelocityStrength(strength: number): void; + Destroy(): void; +} + +interface CameraControlsConstructor { + readonly ClassName: 'CameraControls'; + new ( + zoomedCamera: SmoothZoomedCamera, + rotatedCamera: SmoothRotatedCamera + ): CameraControls; + + MOUSE_SENSITIVITY: Vector2; +} + +export const CameraControls: CameraControlsConstructor; diff --git a/src/camera/src/Client/Controls/CameraGamepadInputUtils.d.ts b/src/camera/src/Client/Controls/CameraGamepadInputUtils.d.ts new file mode 100644 index 00000000000..eaf6f0c623f --- /dev/null +++ b/src/camera/src/Client/Controls/CameraGamepadInputUtils.d.ts @@ -0,0 +1,4 @@ +export namespace CameraGamepadInputUtils { + function outOfDeadZone(inputObject: InputObject): boolean; + function gamepadLinearToCurve(thumbstickPosition: Vector2): Vector2; +} diff --git a/src/camera/src/Client/Controls/GamepadRotateModel.d.ts b/src/camera/src/Client/Controls/GamepadRotateModel.d.ts new file mode 100644 index 00000000000..85a9531ea18 --- /dev/null +++ b/src/camera/src/Client/Controls/GamepadRotateModel.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ValueObject } from '@quenty/valueobject'; + +interface GamepadRotateModel extends BaseObject { + IsRotating: ValueObject; + SetAcceleration(acceleration: number): void; + GetThumbstickDeltaAngle(): Vector2; + StopRotate(): void; + HandleThumbstickInput(input: Vector2): void; +} + +interface GamepadRotateModelConstructor { + readonly ClassName: 'GamepadRotateModel'; + new (): GamepadRotateModel; +} + +export const GamepadRotateModel: GamepadRotateModelConstructor; diff --git a/src/camera/src/Client/Effects/CameraEffectUtils.d.ts b/src/camera/src/Client/Effects/CameraEffectUtils.d.ts new file mode 100644 index 00000000000..561324404ab --- /dev/null +++ b/src/camera/src/Client/Effects/CameraEffectUtils.d.ts @@ -0,0 +1,7 @@ +import { CameraState } from '../CameraState'; + +export interface CameraEffect { + CameraState: CameraState; +} + +export type CameraLike = CameraEffect | CameraState; diff --git a/src/camera/src/Client/Effects/CustomCameraEffect.d.ts b/src/camera/src/Client/Effects/CustomCameraEffect.d.ts new file mode 100644 index 00000000000..baf1675a95d --- /dev/null +++ b/src/camera/src/Client/Effects/CustomCameraEffect.d.ts @@ -0,0 +1,11 @@ +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface CustomCameraEffect extends CameraEffect {} + +interface CustomCameraEffectConstructor { + readonly ClassName: 'CustomCameraEffect'; + new (getCurrentStateFunc: () => CameraState): CustomCameraEffect; +} + +export const CustomCameraEffect: CustomCameraEffectConstructor; diff --git a/src/camera/src/Client/Effects/DefaultCamera.d.ts b/src/camera/src/Client/Effects/DefaultCamera.d.ts new file mode 100644 index 00000000000..75308f85c87 --- /dev/null +++ b/src/camera/src/Client/Effects/DefaultCamera.d.ts @@ -0,0 +1,28 @@ +import { Brio } from '../../../../brio'; +import { Maid } from '../../../../maid'; +import { Observable } from '../../../../rx'; +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface DefaultCamera extends CameraEffect { + SetRobloxFieldOfView(fieldOfView: number): void; + SetRobloxCameraState(state: CameraState): void; + SetRobloxCFrame(cframe: CFrame): void; + GetRobloxCameraState(): CameraState; + SetLastSetDefaultCamera(DefaultCamera: DefaultCamera): void; + IsFirstPerson(): boolean; + ObserveIsFirstPerson(): Observable; + ObserveIsFirstPersonBrio( + predicate?: (value: boolean) => boolean + ): Observable>; + BindToRenderStep(): Maid; + UnbindFromRenderStep(): void; + Destroy(): void; +} + +interface DefaultCameraConstructor { + readonly ClassName: 'DefaultCamera'; + new (): DefaultCamera; +} + +export const DefaultCamera: DefaultCameraConstructor; diff --git a/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera.d.ts b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera.d.ts new file mode 100644 index 00000000000..d745ea32840 --- /dev/null +++ b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera.d.ts @@ -0,0 +1,23 @@ +import { Spring } from '@quenty/spring'; +import { CameraEffect } from '../CameraEffectUtils'; + +interface FadeBetweenCamera extends CameraEffect { + Damper: number; + Value: number; + Speed: number; + Target: number; + Velocity: number; + CameraA: CameraEffect; + CameraStateA: CameraEffect; + CameraB: CameraEffect; + CameraStateB: CameraEffect; + readonly HasReachedTarget: boolean; + readonly Spring: Spring; +} + +interface FadeBetweenCameraConstructor { + readonly ClassName: 'FadeBetweenCamera'; + new (cameraA: CameraEffect, cameraB: CameraEffect): FadeBetweenCamera; +} + +export const FadeBetweenCamera: FadeBetweenCameraConstructor; diff --git a/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera2.d.ts b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera2.d.ts new file mode 100644 index 00000000000..56cae096f65 --- /dev/null +++ b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera2.d.ts @@ -0,0 +1,3 @@ +import { FadeBetweenCamera } from './FadeBetweenCamera'; + +export const FadeBetweenCamera2: typeof FadeBetweenCamera; diff --git a/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera3.d.ts b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera3.d.ts new file mode 100644 index 00000000000..efbd4d3bf6b --- /dev/null +++ b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera3.d.ts @@ -0,0 +1,3 @@ +import { FadeBetweenCamera } from './FadeBetweenCamera'; + +export const FadeBetweenCamera3: typeof FadeBetweenCamera; diff --git a/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera4.d.ts b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera4.d.ts new file mode 100644 index 00000000000..7ad038d0998 --- /dev/null +++ b/src/camera/src/Client/Effects/FadeBetween/FadeBetweenCamera4.d.ts @@ -0,0 +1,3 @@ +import { FadeBetweenCamera } from './FadeBetweenCamera'; + +export const FadeBetweenCamera4: typeof FadeBetweenCamera; diff --git a/src/camera/src/Client/Effects/FadingCamera.d.ts b/src/camera/src/Client/Effects/FadingCamera.d.ts new file mode 100644 index 00000000000..6695fc82e17 --- /dev/null +++ b/src/camera/src/Client/Effects/FadingCamera.d.ts @@ -0,0 +1,22 @@ +import { Spring } from '../../../../spring/src/Shared/Spring'; +import { CameraState } from '../CameraState'; +import { CameraEffect, CameraLike } from './CameraEffectUtils'; + +interface FadingCamera extends CameraEffect { + Damper: number; + Value: number; + Speed: number; + Target: number; + Spring: Spring; + Camera: CameraLike; + readonly Velocity: number; + readonly CameraState: CameraState; + readonly HasReachedTarget: boolean; +} + +interface FadingCameraConstructor { + readonly ClassName: 'FadingCamera'; + new (camera: CameraLike): FadingCamera; +} + +export const FadingCamera: FadingCameraConstructor; diff --git a/src/camera/src/Client/Effects/HeartbeatCamera.d.ts b/src/camera/src/Client/Effects/HeartbeatCamera.d.ts new file mode 100644 index 00000000000..ba9e4edb694 --- /dev/null +++ b/src/camera/src/Client/Effects/HeartbeatCamera.d.ts @@ -0,0 +1,12 @@ +import { CameraEffect } from './CameraEffectUtils'; + +interface HeartbeatCamera extends CameraEffect { + ForceUpdateCache(): void; +} + +interface HeartbeatCameraConstructor { + readonly ClassName: 'HeartbeatCamera'; + new (camera: CameraEffect): HeartbeatCamera; +} + +export const HeartbeatCamera: HeartbeatCameraConstructor; diff --git a/src/camera/src/Client/Effects/ImpulseCamera.d.ts b/src/camera/src/Client/Effects/ImpulseCamera.d.ts new file mode 100644 index 00000000000..0967a317457 --- /dev/null +++ b/src/camera/src/Client/Effects/ImpulseCamera.d.ts @@ -0,0 +1,13 @@ +import { CameraEffect } from './CameraEffectUtils'; + +interface ImpulseCamera extends CameraEffect { + Impulse(velocity: Vector3, speed?: number, damper?: number): void; + ImpulseRandom(velocity: Vector3, speed?: number, damper?: number): void; +} + +interface ImpulseCameraConstructor { + readonly ClassName: 'ImpulseCamera'; + new (): ImpulseCamera; +} + +export const ImpulseCamera: ImpulseCameraConstructor; diff --git a/src/camera/src/Client/Effects/InverseFader.d.ts b/src/camera/src/Client/Effects/InverseFader.d.ts new file mode 100644 index 00000000000..cfcf1e37fd8 --- /dev/null +++ b/src/camera/src/Client/Effects/InverseFader.d.ts @@ -0,0 +1,11 @@ +import { CameraEffect } from './CameraEffectUtils'; +import { FadingCamera } from './FadingCamera'; + +interface InverseFader extends CameraEffect {} + +interface InverseFaderConstructor { + readonly ClassName: 'InverseFader'; + new (camera: CameraEffect, fader: FadingCamera): InverseFader; +} + +export const InverseFader: InverseFaderConstructor; diff --git a/src/camera/src/Client/Effects/LagPointCamera.d.ts b/src/camera/src/Client/Effects/LagPointCamera.d.ts new file mode 100644 index 00000000000..7a418575307 --- /dev/null +++ b/src/camera/src/Client/Effects/LagPointCamera.d.ts @@ -0,0 +1,22 @@ +import { Spring } from '@quenty/spring'; +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface LagPointCamera extends CameraEffect { + readonly Origin: CameraState; + readonly FocusPosition: Vector3; + FocusSpring: Spring; + OriginCamera: CameraEffect; + FocusCamera: CameraEffect; + Speed: number; + Damper: number; + Velocity: Vector3; + LastFocusUpdate: number; +} + +interface LagPointCameraConstructor { + readonly ClassName: 'LagPointCamera'; + new (originCamera: CameraEffect, focusCamera: CameraEffect): LagPointCamera; +} + +export const LagPointCamera: LagPointCameraConstructor; diff --git a/src/camera/src/Client/Effects/OverrideDefaultCameraToo.d.ts b/src/camera/src/Client/Effects/OverrideDefaultCameraToo.d.ts new file mode 100644 index 00000000000..ae547400ee0 --- /dev/null +++ b/src/camera/src/Client/Effects/OverrideDefaultCameraToo.d.ts @@ -0,0 +1,19 @@ +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface OverrideDefaultCameraToo extends CameraEffect { + BaseCamera: CameraEffect; + DefaultCamera: CameraEffect; + Predicate?: (cameraState: CameraState) => boolean; +} + +interface OverrideDefaultCameraTooConstructor { + readonly ClassName: 'OverrideDefaultCameraToo'; + new ( + baseCamera: CameraEffect, + defaultCamera: CameraEffect, + predicate: (cameraState: CameraState) => boolean + ): OverrideDefaultCameraToo; +} + +export const OverrideDefaultCameraToo: OverrideDefaultCameraTooConstructor; diff --git a/src/camera/src/Client/Effects/PointCamera.d.ts b/src/camera/src/Client/Effects/PointCamera.d.ts new file mode 100644 index 00000000000..468e98f4e41 --- /dev/null +++ b/src/camera/src/Client/Effects/PointCamera.d.ts @@ -0,0 +1,16 @@ +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface PointCamera extends CameraEffect { + OriginCamera: CameraEffect; + FocusCamera: CameraEffect; + readonly Focus: CameraState; + readonly Origin: CameraState; +} + +interface PointCameraConstructor { + readonly ClassName: 'PointCamera'; + new (originCamera: CameraEffect, focusCamera: CameraEffect): PointCamera; +} + +export const PointCamera: PointCameraConstructor; diff --git a/src/camera/src/Client/Effects/PushCamera.d.ts b/src/camera/src/Client/Effects/PushCamera.d.ts new file mode 100644 index 00000000000..33266ccea53 --- /dev/null +++ b/src/camera/src/Client/Effects/PushCamera.d.ts @@ -0,0 +1,26 @@ +import { CameraFrame } from '../Utility/CameraFrame'; +import { CameraEffect } from './CameraEffectUtils'; + +interface PushCamera extends CameraEffect { + CFrame: CameraFrame; + set DefaultCFrame(value: CameraFrame); + AngleY: number; + AngleX: number; + AngleXZ: number; + MinY: number; + MaxY: number; + LastUpdateTime: number; + readonly PercentFadedCurved: number; + readonly PercentFaded: number; + readonly LookVector: Vector3; + Reset(): void; + StopRotateBack(): void; + RotateXY(xzrotVector: Vector2): void; +} + +interface PushCameraConstructor { + readonly ClassName: 'PushCamera'; + new (): PushCamera; +} + +export const PushCamera: PushCameraConstructor; diff --git a/src/camera/src/Client/Effects/RotatedCamera.d.ts b/src/camera/src/Client/Effects/RotatedCamera.d.ts new file mode 100644 index 00000000000..8bcb74df40c --- /dev/null +++ b/src/camera/src/Client/Effects/RotatedCamera.d.ts @@ -0,0 +1,22 @@ +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface RotatedCamera extends CameraEffect { + CFrame: CFrame; + CameraState: CameraState; + AngleY: number; + AngleX: number; + AngleXZ: number; + MinY: number; + MaxY: number; + readonly LookVector: Vector3; + + RotateXY(xzrotvector: Vector2): void; +} + +interface RotatedCameraConstructor { + readonly ClassName: 'RotatedCamera'; + new (): RotatedCamera; +} + +export const RotatedCamera: RotatedCameraConstructor; diff --git a/src/camera/src/Client/Effects/SmoothPositionCamera.d.ts b/src/camera/src/Client/Effects/SmoothPositionCamera.d.ts new file mode 100644 index 00000000000..d0c0ebbd44e --- /dev/null +++ b/src/camera/src/Client/Effects/SmoothPositionCamera.d.ts @@ -0,0 +1,19 @@ +import { Spring } from '@quenty/spring'; +import { CameraEffect } from './CameraEffectUtils'; + +interface SmoothPositionCamera extends CameraEffect { + Spring: Spring; + Speed: number; + BaseCamera: CameraEffect; + Damper: number; + Velocity: Vector3; + Target: Vector3; + Position: Vector3; +} + +interface SmoothPositionCameraConstructor { + readonly ClassName: 'SmoothPositionCamera'; + new (baseCamera: CameraEffect): SmoothPositionCamera; +} + +export const SmoothPositionCamera: SmoothPositionCameraConstructor; diff --git a/src/camera/src/Client/Effects/SmoothRotatedCamera.d.ts b/src/camera/src/Client/Effects/SmoothRotatedCamera.d.ts new file mode 100644 index 00000000000..326102b0299 --- /dev/null +++ b/src/camera/src/Client/Effects/SmoothRotatedCamera.d.ts @@ -0,0 +1,38 @@ +import { Spring } from '@quenty/spring'; +import { CameraEffect } from './CameraEffectUtils'; +import { CameraState } from '../CameraState'; + +interface SmoothRotatedCamera extends CameraEffect { + AngleX: number; + AngleXZ: number; + RenderAngleXZ: number; + AngleY: number; + CFrame: CFrame; + TargetCFrame: CFrame; + RenderAngleY: number; + CameraState: CameraState; + MaxY: number; + MinY: number; + Rotation: CFrame; + Speed: number; + ZoomGiveY: number; + SpeedAngleX: number; + SpeedAngleY: number; + SpringX: Spring; + SpringY: Spring; + TargetAngleX: number; + TargetAngleXZ: number; + TargetAngleY: number; + TargetXZ: number; + + RotateXY(xyRotateVector: Vector2): void; + SnapIntoBounds(): void; + GetPastBounds(angle: number): number; +} + +interface SmoothRotatedCameraConstructor { + readonly ClassName: 'SmoothRotatedCamera'; + new (): SmoothRotatedCamera; +} + +export const SmoothRotatedCamera: SmoothRotatedCameraConstructor; diff --git a/src/camera/src/Client/Effects/SmoothZoomedCamera.d.ts b/src/camera/src/Client/Effects/SmoothZoomedCamera.d.ts new file mode 100644 index 00000000000..9cc07c8aedf --- /dev/null +++ b/src/camera/src/Client/Effects/SmoothZoomedCamera.d.ts @@ -0,0 +1,29 @@ +import { Spring } from '@quenty/spring'; +import { CameraEffect } from './CameraEffectUtils'; + +interface SmoothZoomedCamera extends CameraEffect { + Zoom: number; + Speed: number; + Range: number; + MaxZoom: number; + MinZoom: number; + Target: number; + Value: number; + Velocity: number; + TargetZoom: number; + Spring: Spring; + TargetPercentZoom: number; + PercentZoom: number; + Damper: number; + readonly HasReachedTarget: boolean; + + ZoomIn(value: number, min?: number, max?: number): void; + Impulse(value: number): void; +} + +interface SmoothZoomedCameraConstructor { + readonly ClassName: 'SmoothZoomedCamera'; + new (): SmoothZoomedCamera; +} + +export const SmoothZoomedCamera: SmoothZoomedCameraConstructor; diff --git a/src/camera/src/Client/Effects/SummedCamera.d.ts b/src/camera/src/Client/Effects/SummedCamera.d.ts new file mode 100644 index 00000000000..4ee1a2f3a57 --- /dev/null +++ b/src/camera/src/Client/Effects/SummedCamera.d.ts @@ -0,0 +1,17 @@ +import { CameraState } from '../CameraState'; +import { CameraEffect } from './CameraEffectUtils'; + +interface SummedCamera extends CameraEffect { + readonly CameraAState: CameraState; + readonly CameraBState: CameraState; + SetMode(mode: 'World' | 'Relative'): this; + __add(other: CameraEffect): SummedCamera; + __sub(other: CameraEffect): CameraEffect; +} + +interface SummedCameraConstructor { + readonly ClassName: 'SummedCamera'; + new (cameraA: CameraEffect, cameraB: CameraEffect): SummedCamera; +} + +export const SummedCamera: SummedCameraConstructor; diff --git a/src/camera/src/Client/Effects/TrackCamera.d.ts b/src/camera/src/Client/Effects/TrackCamera.d.ts new file mode 100644 index 00000000000..923196200d2 --- /dev/null +++ b/src/camera/src/Client/Effects/TrackCamera.d.ts @@ -0,0 +1,13 @@ +import { CameraEffect } from './CameraEffectUtils'; + +interface TrackCamera extends CameraEffect { + CameraSubject?: BasePart | Model | Attachment | Humanoid; + FieldOfView?: number; +} + +interface TrackCameraConstructor { + readonly ClassName: 'TrackCamera'; + new (cameraSubject?: BasePart | Model | Attachment | Humanoid): TrackCamera; +} + +export const TrackCamera: TrackCameraConstructor; diff --git a/src/camera/src/Client/Effects/XZPlaneLockCamera.d.ts b/src/camera/src/Client/Effects/XZPlaneLockCamera.d.ts new file mode 100644 index 00000000000..19388a294d3 --- /dev/null +++ b/src/camera/src/Client/Effects/XZPlaneLockCamera.d.ts @@ -0,0 +1,10 @@ +import { CameraEffect, CameraLike } from './CameraEffectUtils'; + +interface XZPlaneLockCamera extends CameraEffect {} + +interface XZPlaneLockCameraConstructor { + readonly ClassName: 'XZPlaneLockCamera'; + new (camera?: CameraLike): XZPlaneLockCamera; +} + +export const XZPlaneLockCamera: XZPlaneLockCameraConstructor; diff --git a/src/camera/src/Client/Effects/ZoomedCamera.d.ts b/src/camera/src/Client/Effects/ZoomedCamera.d.ts new file mode 100644 index 00000000000..c2eb6fc7fd9 --- /dev/null +++ b/src/camera/src/Client/Effects/ZoomedCamera.d.ts @@ -0,0 +1,17 @@ +import { CameraEffect } from './CameraEffectUtils'; + +interface ZoomedCamera extends CameraEffect { + Zoom: number; + TargetZoom: number; + MinZoom: number; + MaxZoom: number; + + ZoomIn(value: number, min?: number, max?: number): void; +} + +interface ZoomedCameraConstructor { + readonly ClassName: 'ZoomedCamera'; + new (): ZoomedCamera; +} + +export const ZoomedCamera: ZoomedCameraConstructor; diff --git a/src/camera/src/Client/Input/CameraInputUtils.d.ts b/src/camera/src/Client/Input/CameraInputUtils.d.ts new file mode 100644 index 00000000000..6e7decba25a --- /dev/null +++ b/src/camera/src/Client/Input/CameraInputUtils.d.ts @@ -0,0 +1,8 @@ +export namespace CameraInputUtils { + function getPanBy(panDelta: Vector2, sensitivity: Vector2): Vector2; + function convertToPanDelta(vector3: Vector3): Vector2; + function getInversionVector(userGameSettings: UserGameSettings): Vector2; + function invertSensitivity(sensitivity: Vector2): Vector2; + function isPortraitMode(aspectRatio: number): boolean; + function getCappedAspectRatio(viweportSize: Vector2): number; +} diff --git a/src/camera/src/Client/Input/CameraTouchInputUtils.d.ts b/src/camera/src/Client/Input/CameraTouchInputUtils.d.ts new file mode 100644 index 00000000000..9ff55a45737 --- /dev/null +++ b/src/camera/src/Client/Input/CameraTouchInputUtils.d.ts @@ -0,0 +1,7 @@ +export namespace CameraTouchInputUtils { + function adjustTouchSensitivity( + currPitchAngle: number, + sensitivity: Vector2, + delta: Vector2 + ): Vector2; +} diff --git a/src/camera/src/Client/Utility/CameraFrame.d.ts b/src/camera/src/Client/Utility/CameraFrame.d.ts new file mode 100644 index 00000000000..b413f977464 --- /dev/null +++ b/src/camera/src/Client/Utility/CameraFrame.d.ts @@ -0,0 +1,25 @@ +import { QFrame } from '../../../../qframe/src/Shared/QFrame'; + +interface CameraFrame { + CFrame: CFrame; + Position: Vector3; + FieldOfView: number; + QFrame: QFrame; + + __add(other: CameraFrame): CameraFrame; + __sub(other: CameraFrame): CameraFrame; + __unm(): CameraFrame; + __mul(scalar: number): CameraFrame; + __div(scalar: number): CameraFrame; + __pow(scalar: number): CameraFrame; + __eq(other: CameraFrame): boolean; +} + +interface CameraFrameConstructor { + readonly ClassName: 'CameraFrame'; + new (qFrame?: QFrame, fieldOfView?: number): CameraFrame; + + isCameraFrame: (value: unknown) => value is CameraFrame; +} + +export const CameraFrame: CameraFrameConstructor; diff --git a/src/camera/src/Client/Utility/CameraStateTweener.d.ts b/src/camera/src/Client/Utility/CameraStateTweener.d.ts new file mode 100644 index 00000000000..9aba9d1d68d --- /dev/null +++ b/src/camera/src/Client/Utility/CameraStateTweener.d.ts @@ -0,0 +1,29 @@ +import { ServiceBag } from '../../../../servicebag'; +import { CameraStack } from '../CameraStack'; +import { CameraEffect, CameraLike } from '../Effects/CameraEffectUtils'; + +type CameraStateTweener = { + getPercentVisible(): number; + Show(doNotAnimate?: boolean): void; + Hide(doNotAnimate?: boolean): void; + IsFinishedHiding(): boolean; + IsFinishedShowing(): boolean; + Finish(doNotAnimate: boolean | undefined, callback: () => void): void; + GetCameraEffect(): CameraEffect; + GetCameraBelow(): CameraEffect; + SetTarget(target: number, doNotAnimate?: boolean): void; + SetSpeed(speed: number): void; + SetVisible(isVisible: boolean, doNotAnimate?: boolean): void; + GetFader(): CameraEffect; +}; + +interface CameraStateTweenerConstructor { + readonly ClassName: 'CameraStateTweener'; + new ( + serviceBagOrCameraStack: ServiceBag | CameraStack, + cameraEffect: CameraLike, + speed?: number + ): CameraStateTweener; +} + +export const CameraStateTweener: CameraStateTweenerConstructor; diff --git a/src/camera/src/Client/Utility/CameraSubjectUtils.d.ts b/src/camera/src/Client/Utility/CameraSubjectUtils.d.ts new file mode 100644 index 00000000000..9a1b5d2aa39 --- /dev/null +++ b/src/camera/src/Client/Utility/CameraSubjectUtils.d.ts @@ -0,0 +1,5 @@ +export namespace CameraSubjectUtils { + function getRobloxCameraSubjectCFrame( + cameraSubject: Instance + ): CFrame | undefined; +} diff --git a/src/camera/src/Client/Utility/FieldOfViewUtils.d.ts b/src/camera/src/Client/Utility/FieldOfViewUtils.d.ts new file mode 100644 index 00000000000..a4a9c168432 --- /dev/null +++ b/src/camera/src/Client/Utility/FieldOfViewUtils.d.ts @@ -0,0 +1,11 @@ +export namespace FieldOfViewUtils { + function fovToHeight(fov: number): number; + function heightToFov(height: number): number; + function safeLog(height: number, linearAt: number): number; + function safeExp(logHeight: number, linearAt: number): number; + function lerpInHeightSpace( + fov0: number, + fov1: number, + percent: number + ): number; +} diff --git a/src/camerainfo/index.d.ts b/src/camerainfo/index.d.ts new file mode 100644 index 00000000000..f2816bd0ec8 --- /dev/null +++ b/src/camerainfo/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/CameraInfoUtils'; diff --git a/src/camerainfo/src/Shared/CameraInfoUtils.d.ts b/src/camerainfo/src/Shared/CameraInfoUtils.d.ts new file mode 100644 index 00000000000..a085628a426 --- /dev/null +++ b/src/camerainfo/src/Shared/CameraInfoUtils.d.ts @@ -0,0 +1,15 @@ +export interface CameraInfo { + cframe: CFrame; + viewPortSize: Vector2; + fieldOfView: number; +} + +export namespace CameraInfoUtils { + function createCameraInfo( + cframe: CFrame, + viewPortSize: Vector2, + fieldOfView: number + ): CameraInfo; + function fromCamera(camera: Camera): CameraInfo; + function isCameraInfo(value: unknown): value is CameraInfo; +} diff --git a/src/camerastoryutils/index.d.ts b/src/camerastoryutils/index.d.ts new file mode 100644 index 00000000000..c3553cc5fb6 --- /dev/null +++ b/src/camerastoryutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/CameraStoryUtils'; diff --git a/src/camerastoryutils/src/Client/CameraStoryUtils.d.ts b/src/camerastoryutils/src/Client/CameraStoryUtils.d.ts new file mode 100644 index 00000000000..d714a5d7ba3 --- /dev/null +++ b/src/camerastoryutils/src/Client/CameraStoryUtils.d.ts @@ -0,0 +1,25 @@ +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +export namespace CameraStoryUtils { + function reflectCamera(maid: Maid, topCamera: Camera): Camera; + function setupViewportFrame(maid: Maid, target: GuiBase): ViewportFrame; + function promiseCrate( + maid: Maid, + viewportFrame: ViewportFrame, + properties: Partial> + ): Promise; + function getInterpolationFactory( + maid: Maid, + viewportFrame: ViewportFrame, + low: number, + high: number, + period: number, + toCFrame: (cframe: CFrame) => CFrame + ): ( + interpolate: (t: number) => CFrame, + color: Color3, + label?: string, + labelOffset?: Vector2 + ) => void; +} diff --git a/src/cancellabledelay/index.d.ts b/src/cancellabledelay/index.d.ts new file mode 100644 index 00000000000..c68237159d3 --- /dev/null +++ b/src/cancellabledelay/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/cancellableDelay'; diff --git a/src/cancellabledelay/src/Shared/cancellableDelay.d.ts b/src/cancellabledelay/src/Shared/cancellableDelay.d.ts new file mode 100644 index 00000000000..d510e65d133 --- /dev/null +++ b/src/cancellabledelay/src/Shared/cancellableDelay.d.ts @@ -0,0 +1,8 @@ +export const cancellableDelay: < + Args, + TupleArgs extends Args extends unknown[] ? Args : [Args] +>( + timeoutInSeconds: number, + func: (...args: TupleArgs) => void, + ...args: TupleArgs +) => () => void; diff --git a/src/canceltoken/index.d.ts b/src/canceltoken/index.d.ts new file mode 100644 index 00000000000..2b9d784776d --- /dev/null +++ b/src/canceltoken/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/CancelToken'; diff --git a/src/canceltoken/src/Shared/CancelToken.d.ts b/src/canceltoken/src/Shared/CancelToken.d.ts new file mode 100644 index 00000000000..42432ada017 --- /dev/null +++ b/src/canceltoken/src/Shared/CancelToken.d.ts @@ -0,0 +1,19 @@ +import { Maid } from '@quenty/maid'; +import { Signal } from '@quenty/signal'; + +type CancelToken = { + Cancelled: Signal; + ErrorIfCancelled(): void; + IsCancelled(): boolean; +}; + +interface CancelTokenConstructor { + readonly ClassName: 'CancelToken'; + new (executor: (cancel: () => void, maid: Maid) => void): CancelToken; + + isCancelToken: (value: unknown) => value is CancelToken; + fromMaid: (maid: Maid) => CancelToken; + fromSeconds: (seconds: number) => CancelToken; +} + +export const CancelToken: CancelTokenConstructor; diff --git a/src/cframeserializer/index.d.ts b/src/cframeserializer/index.d.ts new file mode 100644 index 00000000000..15fb31a7973 --- /dev/null +++ b/src/cframeserializer/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/CFrameSerializer'; diff --git a/src/cframeserializer/src/Shared/CFrameSerializer.d.ts b/src/cframeserializer/src/Shared/CFrameSerializer.d.ts new file mode 100644 index 00000000000..24702c3994a --- /dev/null +++ b/src/cframeserializer/src/Shared/CFrameSerializer.d.ts @@ -0,0 +1,12 @@ +type SerializedCFrame = [number, number, number, number, number, number] & { + __brand: 'SerializedCFrame'; +}; + +export namespace CFrameSerializer { + function outputRotationAzure(cframe: CFrame): SerializedCFrame; + function toJSONString(cframe: CFrame): string; + function isRotationAzure(value: unknown): value is SerializedCFrame; + function fromJSONString(str: string): CFrame | undefined; + function readPosition(data: SerializedCFrame): Vector3; + function readRotationAzure(data: SerializedCFrame): CFrame; +} diff --git a/src/cframeutils/index.d.ts b/src/cframeutils/index.d.ts new file mode 100644 index 00000000000..49898cd895d --- /dev/null +++ b/src/cframeutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/CFrameUtils'; +export * from './src/Shared/getRotationInXZPlane'; diff --git a/src/cframeutils/src/Shared/CFrameUtils.d.ts b/src/cframeutils/src/Shared/CFrameUtils.d.ts new file mode 100644 index 00000000000..faba22d5706 --- /dev/null +++ b/src/cframeutils/src/Shared/CFrameUtils.d.ts @@ -0,0 +1,23 @@ +export namespace CFrameUtils { + function lookAt( + position: Vector3, + target: Vector3, + upVector?: Vector3 + ): CFrame; + function cframeFromTo(a: Vector3, b: Vector3): CFrame; + function redirectLocalAxis( + cframe: CFrame, + localAxis: Vector3, + worldGoal: Vector3 + ): CFrame; + function axisAngleToCFrame(axisAngle: Vector3, position?: Vector3): CFrame; + function fromUpRight( + position: Vector3, + upVector: Vector3, + rightVector: Vector3 + ): CFrame | undefined; + function scalePosition(cframe: CFrame, scale: number): CFrame; + function reflect(vector: Vector3, unitNormal: Vector3): Vector3; + function mirror(cframe: CFrame, point?: Vector3, normal?: Vector3): CFrame; + function areClose(a: CFrame, b: CFrame, epsilon: number): boolean; +} diff --git a/src/cframeutils/src/Shared/getRotationInXZPlane.d.ts b/src/cframeutils/src/Shared/getRotationInXZPlane.d.ts new file mode 100644 index 00000000000..70bc79042d7 --- /dev/null +++ b/src/cframeutils/src/Shared/getRotationInXZPlane.d.ts @@ -0,0 +1 @@ +export const getRotationInXZPlane: (cframe: CFrame) => CFrame; diff --git a/src/characterparticleplayer/index.d.ts b/src/characterparticleplayer/index.d.ts new file mode 100644 index 00000000000..5533bf2f3d8 --- /dev/null +++ b/src/characterparticleplayer/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ParticlePlayer'; diff --git a/src/characterparticleplayer/src/Shared/ParticlePlayer.d.ts b/src/characterparticleplayer/src/Shared/ParticlePlayer.d.ts new file mode 100644 index 00000000000..4d105e6e84e --- /dev/null +++ b/src/characterparticleplayer/src/Shared/ParticlePlayer.d.ts @@ -0,0 +1,10 @@ +interface ParticlePlayer { + PlayLevelUpEffect(humanoid: Humanoid): boolean; +} + +interface ParticlePlayerConstructor { + readonly ClassName: 'ParticlePlayer'; + new (): ParticlePlayer; +} + +export const ParticlePlayer: ParticlePlayerConstructor; diff --git a/src/characterutils/index.d.ts b/src/characterutils/index.d.ts new file mode 100644 index 00000000000..ba8b4ee0e40 --- /dev/null +++ b/src/characterutils/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Shared/CharacterPromiseUtils'; +export * from './src/Shared/CharacterUtils'; +export * from './src/Shared/RootPartUtils'; +export * from './src/Shared/RxCharacterUtils'; +export * from './src/Shared/RxRootPartUtils'; diff --git a/src/characterutils/src/Shared/CharacterPromiseUtils.d.ts b/src/characterutils/src/Shared/CharacterPromiseUtils.d.ts new file mode 100644 index 00000000000..2ce69e97647 --- /dev/null +++ b/src/characterutils/src/Shared/CharacterPromiseUtils.d.ts @@ -0,0 +1,5 @@ +import { Promise } from '@quenty/promise'; + +export namespace CharacterPromiseUtils { + function promiseCharacter(player: Player): Promise; +} diff --git a/src/characterutils/src/Shared/CharacterUtils.d.ts b/src/characterutils/src/Shared/CharacterUtils.d.ts new file mode 100644 index 00000000000..8841ab7f2ff --- /dev/null +++ b/src/characterutils/src/Shared/CharacterUtils.d.ts @@ -0,0 +1,8 @@ +export namespace CharacterUtils { + function getPlayerHumanoid(player: Player): Humanoid | undefined; + function getAlivePlayerHumanoid(player: Player): Humanoid | undefined; + function getAlivePlayerRootPart(player: Player): BasePart | undefined; + function getPlayerRootPart(player: Player): BasePart | undefined; + function unequipTools(player: Player): void; + function getPlayerFromCharacter(descendant: Instance): Player | undefined; +} diff --git a/src/characterutils/src/Shared/RootPartUtils.d.ts b/src/characterutils/src/Shared/RootPartUtils.d.ts new file mode 100644 index 00000000000..986765a8950 --- /dev/null +++ b/src/characterutils/src/Shared/RootPartUtils.d.ts @@ -0,0 +1,6 @@ +import { Promise } from '@quenty/promise'; + +export namespace RootPartUtils { + function promiseRootPart(humanoid: Humanoid): Promise; + function getRootPart(character: Model): BasePart | undefined; +} diff --git a/src/characterutils/src/Shared/RxCharacterUtils.d.ts b/src/characterutils/src/Shared/RxCharacterUtils.d.ts new file mode 100644 index 00000000000..92842f2d4ae --- /dev/null +++ b/src/characterutils/src/Shared/RxCharacterUtils.d.ts @@ -0,0 +1,17 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxCharacterUtils { + function observeLastCharacterBrio(player: Player): Observable>; + function observeCharacter(player: Player): Observable; + function observeCharacterBrio(player: Player): Observable>; + function observeIsOfLocalCharacter(instance: Instance): Observable; + function observeIsOfLocalCharacterBrio( + instance: Instance + ): Observable>; + function observeLocalPlayerCharacter(): Observable; + function observeLastHumanoidBrio(player: Player): Observable>; + function observeLastAliveHumanoidBrio( + player: Player + ): Observable>; +} diff --git a/src/characterutils/src/Shared/RxRootPartUtils.d.ts b/src/characterutils/src/Shared/RxRootPartUtils.d.ts new file mode 100644 index 00000000000..dccd46c1ff8 --- /dev/null +++ b/src/characterutils/src/Shared/RxRootPartUtils.d.ts @@ -0,0 +1,11 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxRootPartUtils { + function observeHumanoidRootPartBrio( + character: Model + ): Observable>; + function observeHumanoidRootPartBrioFromHumanoid( + humanoid: Humanoid + ): Observable>; +} diff --git a/src/chatproviderservice/index.d.ts b/src/chatproviderservice/index.d.ts new file mode 100644 index 00000000000..e061e509cdb --- /dev/null +++ b/src/chatproviderservice/index.d.ts @@ -0,0 +1,16 @@ +export * from './src/Client/Binders/ChatTagClient'; +export * from './src/Client/Binders/HasChatTagsClient'; +export * from './src/Client/ChatProviderServiceClient'; +export * from './src/Client/Commands/ChatProviderCommandServiceClient'; +export * from './src/Server/Binders/ChatTag'; +export * from './src/Server/Binders/HasChatTags'; +export * from './src/Server/ChatProviderService'; +export * from './src/Server/Commands/ChatProviderCommandService'; +export * from './src/Shared/Binders/ChatTagBase'; +export * from './src/Shared/Binders/HasChatTagsBase'; +export * from './src/Shared/ChatProviderTranslator'; +export * from './src/Shared/ChatTagConstants'; +export * from './src/Shared/Commands/ChatTagCmdrUtils'; +export * from './src/Shared/Data/ChatTagDataUtils'; +export * from './src/Shared/HasChatTagsConstants'; +export * from './src/Shared/TextChannelUtils'; diff --git a/src/chatproviderservice/src/Client/Binders/ChatTagClient.d.ts b/src/chatproviderservice/src/Client/Binders/ChatTagClient.d.ts new file mode 100644 index 00000000000..3a93b9d07ab --- /dev/null +++ b/src/chatproviderservice/src/Client/Binders/ChatTagClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { ChatTagBase } from '../../Shared/Binders/ChatTagBase'; +import { Binder } from '@quenty/binder'; + +interface ChatTagClient extends ChatTagBase {} + +interface ChatTagClientConstructor { + readonly ClassName: 'ChatTagClient'; + new (folder: Folder, serviceBag: ServiceBag): ChatTagClient; +} + +export const ChatTagClient: Binder; diff --git a/src/chatproviderservice/src/Client/Binders/HasChatTagsClient.d.ts b/src/chatproviderservice/src/Client/Binders/HasChatTagsClient.d.ts new file mode 100644 index 00000000000..08e442f0611 --- /dev/null +++ b/src/chatproviderservice/src/Client/Binders/HasChatTagsClient.d.ts @@ -0,0 +1,16 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { HasChatTagsBase } from '../../Shared/Binders/HasChatTagsBase'; +import { ChatTagClient } from './ChatTagClient'; + +interface HasChatTagsClient extends HasChatTagsBase { + GetChatTagBinder(): Binder; + GetAsRichText(): string | undefined; +} + +interface HasChatTagsClientConstructor { + readonly ClassName: 'HasChatTagsClient'; + new (player: Player, serviceBag: ServiceBag): HasChatTagsClient; +} + +export const HasChatTagsClient: Binder; diff --git a/src/chatproviderservice/src/Client/ChatProviderServiceClient.d.ts b/src/chatproviderservice/src/Client/ChatProviderServiceClient.d.ts new file mode 100644 index 00000000000..bbbff53119d --- /dev/null +++ b/src/chatproviderservice/src/Client/ChatProviderServiceClient.d.ts @@ -0,0 +1 @@ +export interface ChatProviderServiceClient {} diff --git a/src/chatproviderservice/src/Client/Commands/ChatProviderCommandServiceClient.d.ts b/src/chatproviderservice/src/Client/Commands/ChatProviderCommandServiceClient.d.ts new file mode 100644 index 00000000000..b3aa2679609 --- /dev/null +++ b/src/chatproviderservice/src/Client/Commands/ChatProviderCommandServiceClient.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface ChatProviderCommandServiceClient { + readonly ServiceName: 'ChatProviderCommandServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetChatTagKeyList(): string[]; +} diff --git a/src/chatproviderservice/src/Server/Binders/ChatTag.d.ts b/src/chatproviderservice/src/Server/Binders/ChatTag.d.ts new file mode 100644 index 00000000000..8d0b4b22890 --- /dev/null +++ b/src/chatproviderservice/src/Server/Binders/ChatTag.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { ChatTagBase } from '../../Shared/Binders/ChatTagBase'; +import { Binder } from '@quenty/binder'; + +interface ChatTag extends ChatTagBase {} + +interface ChatTagConstructor { + readonly ClassName: 'ChatTag'; + new (folder: Folder, serviceBag: ServiceBag): ChatTag; +} + +export const ChatTag: Binder; diff --git a/src/chatproviderservice/src/Server/Binders/HasChatTags.d.ts b/src/chatproviderservice/src/Server/Binders/HasChatTags.d.ts new file mode 100644 index 00000000000..a1eae45469a --- /dev/null +++ b/src/chatproviderservice/src/Server/Binders/HasChatTags.d.ts @@ -0,0 +1,20 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { HasChatTagsBase } from '../../Shared/Binders/HasChatTagsBase'; +import { Binder } from '@quenty/binder'; +import { ChatTag } from './ChatTag'; +import { ChatTagData } from '../../Shared/Data/ChatTagDataUtils'; +import { PlayerBinder } from '@quenty/playerbinder'; + +interface HasChatTags extends HasChatTagsBase { + GetChatTagBinder(): Binder; + AddChatTag(chatTagData: ChatTagData): Folder; + GetChatTagByKey(chatTagKey: string): ChatTagData | undefined; + ClearTags(): void; +} + +interface HasChatTagsConstructor { + readonly ClassName: 'HasChatTags'; + new (player: Player, serviceBag: ServiceBag): HasChatTags; +} + +export const HasChatTags: PlayerBinder; diff --git a/src/chatproviderservice/src/Server/ChatProviderService.d.ts b/src/chatproviderservice/src/Server/ChatProviderService.d.ts new file mode 100644 index 00000000000..910e560e643 --- /dev/null +++ b/src/chatproviderservice/src/Server/ChatProviderService.d.ts @@ -0,0 +1 @@ +export interface ChatProviderService {} diff --git a/src/chatproviderservice/src/Server/Commands/ChatProviderCommandService.d.ts b/src/chatproviderservice/src/Server/Commands/ChatProviderCommandService.d.ts new file mode 100644 index 00000000000..d5221610162 --- /dev/null +++ b/src/chatproviderservice/src/Server/Commands/ChatProviderCommandService.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface ChatProviderCommandService { + readonly ServiceName: 'ChatProviderCommandService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetChatTagKeyList(): string[]; + Destroy(): void; +} diff --git a/src/chatproviderservice/src/Shared/Binders/ChatTagBase.d.ts b/src/chatproviderservice/src/Shared/Binders/ChatTagBase.d.ts new file mode 100644 index 00000000000..bc3b7a24261 --- /dev/null +++ b/src/chatproviderservice/src/Shared/Binders/ChatTagBase.d.ts @@ -0,0 +1,17 @@ +import { AttributeValue } from '@quenty/attributeutils'; +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { ChatTagData } from '../Data/ChatTagDataUtils'; + +interface ChatTagBase extends BaseObject { + UserDisabled: AttributeValue; + ChatTagKey: AttributeValue; + ObserveChatTagData(): Observable; +} + +interface ChatTagBaseConstructor { + readonly ClassName: 'ChatTagBase'; + new (obj: Folder): ChatTagBase; +} + +export const ChatTagBase: ChatTagBaseConstructor; diff --git a/src/chatproviderservice/src/Shared/Binders/HasChatTagsBase.d.ts b/src/chatproviderservice/src/Shared/Binders/HasChatTagsBase.d.ts new file mode 100644 index 00000000000..e5f700219c8 --- /dev/null +++ b/src/chatproviderservice/src/Shared/Binders/HasChatTagsBase.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ChatTagData } from '../Data/ChatTagDataUtils'; +import { Observable } from '@quenty/rx'; + +interface HasChatTagsBase extends BaseObject { + GetLastChatTags(): ChatTagData[] | undefined; + ObserveLastChatTags(): Observable; +} + +interface HasChatTagsBaseConstructor { + readonly ClassName: 'HasChatTagsBase'; + new (player: Player): HasChatTagsBase; +} + +export const HasChatTagsBase: HasChatTagsBaseConstructor; diff --git a/src/chatproviderservice/src/Shared/ChatProviderTranslator.d.ts b/src/chatproviderservice/src/Shared/ChatProviderTranslator.d.ts new file mode 100644 index 00000000000..1d97a6fbc0b --- /dev/null +++ b/src/chatproviderservice/src/Shared/ChatProviderTranslator.d.ts @@ -0,0 +1,3 @@ +import { JSONTranslator } from '@quenty/clienttranslator'; + +export const ChatProviderTranslator: JSONTranslator; diff --git a/src/chatproviderservice/src/Shared/ChatTagConstants.d.ts b/src/chatproviderservice/src/Shared/ChatTagConstants.d.ts new file mode 100644 index 00000000000..8b3c6c65226 --- /dev/null +++ b/src/chatproviderservice/src/Shared/ChatTagConstants.d.ts @@ -0,0 +1,8 @@ +export const ChatTagConstants: Readonly<{ + TAG_TEXT_ATTRIBUTE: 'TagText'; + TAG_COLOR_ATTRIBUTE: 'TagColor'; + TAG_KEY_ATTRIBUTE: 'ChatTagKey'; + TAG_LOCALIZED_TEXT_ATTRIBUTE: 'TagLocalizedText'; + TAG_PRIORITY_ATTRIBUTE: 'TagPriority'; + USER_DISABLED_ATTRIBUTE: 'UserDisabled'; +}>; diff --git a/src/chatproviderservice/src/Shared/Commands/ChatTagCmdrUtils.d.ts b/src/chatproviderservice/src/Shared/Commands/ChatTagCmdrUtils.d.ts new file mode 100644 index 00000000000..49ec442ba67 --- /dev/null +++ b/src/chatproviderservice/src/Shared/Commands/ChatTagCmdrUtils.d.ts @@ -0,0 +1,10 @@ +import { Cmdr, CmdrClient } from '@quenty/cmdrservice'; +import { ChatProviderService } from '../../Server/ChatProviderService'; +import { ChatProviderServiceClient } from '../../Client/ChatProviderServiceClient'; + +export namespace ChatTagCmdrUtils { + function registerChatTagKeys( + cmdr: Cmdr | CmdrClient, + chatProviderService: ChatProviderService | ChatProviderServiceClient + ): void; +} diff --git a/src/chatproviderservice/src/Shared/Data/ChatTagDataUtils.d.ts b/src/chatproviderservice/src/Shared/Data/ChatTagDataUtils.d.ts new file mode 100644 index 00000000000..c195d3404ce --- /dev/null +++ b/src/chatproviderservice/src/Shared/Data/ChatTagDataUtils.d.ts @@ -0,0 +1,15 @@ +import { LocalizedTextData } from '@quenty/localizedtextutils'; + +export interface ChatTagData { + TagText: string; + TagPriority: number; + UserDisabled?: boolean; + TagLocalizedText?: LocalizedTextData; + TagColor: Color3; +} + +export namespace ChatTagDataUtils { + function createChatTagData(data: ChatTagData): ChatTagData; + function isChatTagDataList(value: unknown): value is ChatTagData[]; + function isChatTagData(value: unknown): value is ChatTagData; +} diff --git a/src/chatproviderservice/src/Shared/HasChatTagsConstants.d.ts b/src/chatproviderservice/src/Shared/HasChatTagsConstants.d.ts new file mode 100644 index 00000000000..3d0915e7120 --- /dev/null +++ b/src/chatproviderservice/src/Shared/HasChatTagsConstants.d.ts @@ -0,0 +1,3 @@ +export const HasChatTagsConstants: Readonly<{ + TAG_CONTAINER_NAME: 'ChatProviderService_ChatTags'; +}>; diff --git a/src/chatproviderservice/src/Shared/TextChannelUtils.d.ts b/src/chatproviderservice/src/Shared/TextChannelUtils.d.ts new file mode 100644 index 00000000000..a04805e8ccf --- /dev/null +++ b/src/chatproviderservice/src/Shared/TextChannelUtils.d.ts @@ -0,0 +1,5 @@ +export namespace TextChannelUtils { + function getDefaultTextChannel(): TextChannel | undefined; + function getTextChannel(channelName: string): TextChannel | undefined; + function getTextChannels(): Instance | undefined; +} diff --git a/src/clienttranslator/index.d.ts b/src/clienttranslator/index.d.ts new file mode 100644 index 00000000000..c2663f92b98 --- /dev/null +++ b/src/clienttranslator/index.d.ts @@ -0,0 +1,7 @@ +export * from './src/Shared/Conversion/LocalizationEntryParserUtils'; +export * from './src/Shared/JSONTranslator'; +export * from './src/Shared/Numbers/NumberLocalizationUtils'; +export * from './src/Shared/Numbers/RoundingBehaviourTypes'; +export * from './src/Shared/TranslatorService'; +export * from './src/Shared/Utils/LocalizationServiceUtils'; +export * from './src/Shared/Utils/TranslationKeyUtils'; diff --git a/src/clienttranslator/src/Shared/Conversion/LocalizationEntryParserUtils.d.ts b/src/clienttranslator/src/Shared/Conversion/LocalizationEntryParserUtils.d.ts new file mode 100644 index 00000000000..a127d3c22d7 --- /dev/null +++ b/src/clienttranslator/src/Shared/Conversion/LocalizationEntryParserUtils.d.ts @@ -0,0 +1,28 @@ +export type LocalizationDataTable = { + [key: string | number]: string | LocalizationDataTable; +}; + +export type LocalizationDataTableResult = { + [key: string | number]: + | { + Example: string; + Key: string; + Context: string; + Source: string; + Values: Record; + } + | LocalizationDataTableResult; +}; + +export namespace LocalizationEntryParserUtils { + function decodeFromInstance( + tableName: string, + sourceLocaleId: string, + folder: Instance + ): LocalizationDataTableResult; + function decodeFromTable( + tableName: string, + localeId: string, + dataTable: LocalizationDataTable + ): LocalizationDataTableResult; +} diff --git a/src/clienttranslator/src/Shared/JSONTranslator.d.ts b/src/clienttranslator/src/Shared/JSONTranslator.d.ts new file mode 100644 index 00000000000..576b00b29dc --- /dev/null +++ b/src/clienttranslator/src/Shared/JSONTranslator.d.ts @@ -0,0 +1,61 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { LocalizationDataTable } from './Conversion/LocalizationEntryParserUtils'; +import { Observable } from '@quenty/rx'; +import { RoundingBehaviourType } from './Numbers/RoundingBehaviourTypes'; +import { TranslationArgs } from '@quenty/localizedtextutils'; +import { Promise } from '@quenty/promise'; + +interface JSONTranslator { + readonly ServiceName: string; + Init(serviceBag: ServiceBag): void; + ObserveNumber(number: number | Observable): Observable; + ObserveAbbreviatedNumber( + number: number | Observable, + roundingBehaviourType?: RoundingBehaviourType, + numSignificantDigits?: number + ): Observable; + ObserveFormatByKey( + translationKey: string, + translationArgs?: TranslationArgs + ): Observable; + PromiseFormatByKey( + translationKey: string, + translationArgs?: TranslationArgs + ): Promise; + PromiseTranslator(): Promise; + ObserveTranslator(): Observable; + ObserveLocaleId(): Observable; + SetEntryValue( + translationKey: string, + source: string, + context: string, + localeId: string, + text: string + ): void; + ObserveTranslation( + prefix: string, + text: string, + translationArgs?: TranslationArgs + ): Observable; + ToTranslationKey(prefix: string, text: string): string; + GetLocaleId(): string; + GetLocalizationTable(): LocalizationTable; + PromiseLoaded(): Promise; + FormatByKey( + translationKey: string, + translationArgs?: TranslationArgs + ): string; + Destroy(): void; +} + +interface JSONTranslatorConstructor { + readonly ClassName: 'JSONTranslator'; + readonly ServiceName: 'JSONTranslator'; + new ( + translatorName: string, + localeId: string, + dataTable: LocalizationDataTable + ): JSONTranslator; +} + +export const JSONTranslator: JSONTranslatorConstructor; diff --git a/src/clienttranslator/src/Shared/Numbers/NumberLocalizationUtils.d.ts b/src/clienttranslator/src/Shared/Numbers/NumberLocalizationUtils.d.ts new file mode 100644 index 00000000000..63a43f60680 --- /dev/null +++ b/src/clienttranslator/src/Shared/Numbers/NumberLocalizationUtils.d.ts @@ -0,0 +1,11 @@ +import { RoundingBehaviourType } from './RoundingBehaviourTypes'; + +export namespace NumberLocalizationUtils { + function localize(number: number, locale: string): string; + function abbreviate( + number: number, + locale: string, + roundingBehaviourType?: RoundingBehaviourType, + numSignificantDigits?: number + ): string; +} diff --git a/src/clienttranslator/src/Shared/Numbers/RoundingBehaviourTypes.d.ts b/src/clienttranslator/src/Shared/Numbers/RoundingBehaviourTypes.d.ts new file mode 100644 index 00000000000..303c94a0416 --- /dev/null +++ b/src/clienttranslator/src/Shared/Numbers/RoundingBehaviourTypes.d.ts @@ -0,0 +1,8 @@ +export type RoundingBehaviourType = + (typeof RoundingBehaviourTypes)[keyof typeof RoundingBehaviourTypes]; + +export const RoundingBehaviourTypes: Readonly<{ + ROUND_TO_CLOSEST: 'roundToClosest'; + TRUNCATE: 'truncate'; + NONE: 'none'; +}>; diff --git a/src/clienttranslator/src/Shared/TranslatorService.d.ts b/src/clienttranslator/src/Shared/TranslatorService.d.ts new file mode 100644 index 00000000000..521898a3407 --- /dev/null +++ b/src/clienttranslator/src/Shared/TranslatorService.d.ts @@ -0,0 +1,15 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface TranslatorService { + readonly ServiceName: 'TranslatorService'; + Init(serviceBag: ServiceBag): void; + GetLocalizationTable(): LocalizationTable; + ObserveTranslator(): Observable; + PromiseTranslator(): Promise; + GetTranslator(): Translator | undefined; + ObserveLocaleId(): Observable; + GetLocaleId(): string; + Destroy(): void; +} diff --git a/src/clienttranslator/src/Shared/Utils/LocalizationServiceUtils.d.ts b/src/clienttranslator/src/Shared/Utils/LocalizationServiceUtils.d.ts new file mode 100644 index 00000000000..22f129ba68c --- /dev/null +++ b/src/clienttranslator/src/Shared/Utils/LocalizationServiceUtils.d.ts @@ -0,0 +1,6 @@ +import { Promise } from '@quenty/promise'; + +export namespace LocalizationServiceUtils { + function promiseTranslatorForLocale(localeId: string): Promise; + function promisePlayerTranslator(player: Player): Promise; +} diff --git a/src/clienttranslator/src/Shared/Utils/TranslationKeyUtils.d.ts b/src/clienttranslator/src/Shared/Utils/TranslationKeyUtils.d.ts new file mode 100644 index 00000000000..eb1c524fdfd --- /dev/null +++ b/src/clienttranslator/src/Shared/Utils/TranslationKeyUtils.d.ts @@ -0,0 +1,3 @@ +export namespace TranslationKeyUtils { + function getTranslationKey(prefix: string, text: string): string; +} diff --git a/src/clipcharacters/index.d.ts b/src/clipcharacters/index.d.ts new file mode 100644 index 00000000000..92ae20fc118 --- /dev/null +++ b/src/clipcharacters/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/ClipCharacters'; +export * from './src/Client/ClipCharactersServiceClient'; +export * from './src/Server/ClipCharactersService'; +export * from './src/Shared/ClipCharactersServiceConstants'; diff --git a/src/clipcharacters/src/Client/ClipCharacters.d.ts b/src/clipcharacters/src/Client/ClipCharacters.d.ts new file mode 100644 index 00000000000..c7a1f3d2bec --- /dev/null +++ b/src/clipcharacters/src/Client/ClipCharacters.d.ts @@ -0,0 +1,10 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface ClipCharacters extends BaseObject {} + +interface ClipCharactersConstructor { + readonly ClassName: 'ClipCharacters'; + new (): ClipCharacters; +} + +export const ClipCharacters: ClipCharactersConstructor; diff --git a/src/clipcharacters/src/Client/ClipCharactersServiceClient.d.ts b/src/clipcharacters/src/Client/ClipCharactersServiceClient.d.ts new file mode 100644 index 00000000000..79583132082 --- /dev/null +++ b/src/clipcharacters/src/Client/ClipCharactersServiceClient.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface ClipCharactersServiceClient { + readonly ServiceName: 'ClipCharactersServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + PushDisableCharacterCollisionsWithDefault(): () => void; + Destroy(): void; +} diff --git a/src/clipcharacters/src/Server/ClipCharactersService.d.ts b/src/clipcharacters/src/Server/ClipCharactersService.d.ts new file mode 100644 index 00000000000..4a84ecf43fa --- /dev/null +++ b/src/clipcharacters/src/Server/ClipCharactersService.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface ClipCharactersService { + readonly ServiceName: 'ClipCharactersService'; + Init(serviceBag: ServiceBag): void; + Destroy(): void; +} diff --git a/src/clipcharacters/src/Shared/ClipCharactersServiceConstants.d.ts b/src/clipcharacters/src/Shared/ClipCharactersServiceConstants.d.ts new file mode 100644 index 00000000000..f2671c630dd --- /dev/null +++ b/src/clipcharacters/src/Shared/ClipCharactersServiceConstants.d.ts @@ -0,0 +1,3 @@ +export const ClipCharactersServiceConstants: Readonly<{ + COLLISION_GROUP_NAME: 'ClipCharacters'; +}>; diff --git a/src/cmdrservice/index.d.ts b/src/cmdrservice/index.d.ts new file mode 100644 index 00000000000..10aabd4d2c7 --- /dev/null +++ b/src/cmdrservice/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/CmdrServiceClient'; +export * from './src/Server/CmdrService'; +export * from './src/Server/CmdrTemplateProviderServer'; +export * from './src/Shared/CmdrTypes'; diff --git a/src/cmdrservice/src/Client/CmdrServiceClient.d.ts b/src/cmdrservice/src/Client/CmdrServiceClient.d.ts new file mode 100644 index 00000000000..c00d1b3503b --- /dev/null +++ b/src/cmdrservice/src/Client/CmdrServiceClient.d.ts @@ -0,0 +1,9 @@ +import { Promise } from '@quenty/promise'; +import { CmdrClient } from '../Shared/CmdrTypes'; + +export interface CmdrServiceClient { + readonly ServiceName: 'CmdrServiceClient'; + Start(): void; + PromiseCmdr(): Promise; + Destroy(): void; +} diff --git a/src/cmdrservice/src/Server/CmdrService.d.ts b/src/cmdrservice/src/Server/CmdrService.d.ts new file mode 100644 index 00000000000..afe3d1beef8 --- /dev/null +++ b/src/cmdrservice/src/Server/CmdrService.d.ts @@ -0,0 +1,14 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { Cmdr, CommandContext, CommandDefinition } from '../Shared/CmdrTypes'; + +export interface CmdrService { + readonly ServiceName: 'CmdrService'; + Init(serviceBag: ServiceBag): void; + PromiseCmdr(): Promise; + RegisterCommand( + commandData: CommandDefinition, + execute: (context: CommandContext, ...args: any[]) => string | undefined + ): void; + Destroy(): void; +} diff --git a/src/cmdrservice/src/Server/CmdrTemplateProviderServer/index.d.ts b/src/cmdrservice/src/Server/CmdrTemplateProviderServer/index.d.ts new file mode 100644 index 00000000000..1453f291c94 --- /dev/null +++ b/src/cmdrservice/src/Server/CmdrTemplateProviderServer/index.d.ts @@ -0,0 +1,3 @@ +import { TemplateProvider } from '@quenty/templateprovider'; + +export const CmdrTemplateProviderServer: TemplateProvider; diff --git a/src/cmdrservice/src/Shared/CmdrTypes.d.ts b/src/cmdrservice/src/Shared/CmdrTypes.d.ts new file mode 100644 index 00000000000..284da4f41cf --- /dev/null +++ b/src/cmdrservice/src/Shared/CmdrTypes.d.ts @@ -0,0 +1,385 @@ +export type CmdrLike = Cmdr | CmdrClient; + +// stolen from @rbxts/cmdr + +interface ArgumentContext { + /** The command that this argument belongs to. */ + Command: CommandContext; + /** The name of this argument. */ + Name: string; + /** The type definition for this argument. */ + Type: TypeDefinition; + /** Whether or not this argument was required. */ + Required: boolean; + /** The player that ran the command this argument belongs to. */ + Executor: Player; + /** The raw, unparsed value for this argument. */ + RawValue: string; + /** An array of strings representing the values in a comma-separated list, if applicable. */ + RawSegments: Array; + /** The prefix used in this argument (like `%` in `%Team`). Empty string if no prefix was used. See Prefixed Union Types for more details. */ + Prefix: string; + + /** Returns the parsed value for this argument. */ + GetValue(): unknown; + /** Returns the _transformed_ value from this argument, see Types. */ + GetTransformedValue(segment: number): unknown; +} + +interface Cmdr extends Registry { + /** Refers to the current command Registry. */ + readonly Registry: Registry; + /** Refers to the current command Dispatcher. */ + readonly Dispatcher: Dispatcher; + /** Refers to a table containing many useful utility functions. */ + readonly Util: Util; +} + +interface CmdrClient { + /** Refers to the current command Registry. */ + readonly Registry: Registry; + /** Refers to the current command Dispatcher. */ + readonly Dispatcher: Dispatcher; + /** Refers to a table containing many useful utility functions. */ + readonly Util: Util; + readonly Enabled: boolean; + readonly PlaceName: string; + readonly ActivationKeys: Map; + /** Sets the key codes that will hide or show Cmdr. */ + SetActivationKeys(keys: Array): void; + /** Sets the place name label that appears when executing commands. This is useful for a quick way to tell what game you're playing in a universe game. */ + SetPlaceName(labelText: string): void; + /** Sets whether or not Cmdr can be shown via the defined activation keys. Useful for when you want users to need to opt-in to show the console in a settings menu. */ + SetEnabled(isEnabled: boolean): void; + /** Shows the Cmdr window explicitly. Does not do anything if Cmdr is not enabled. */ + Show(): void; + /** Hides the Cmdr window. */ + Hide(): void; + /** Toggles visibility of the Cmdr window. Will not show if Cmdr is not enabled. */ + Toggle(): void; + HandleEvent(event: string, handler: Callback): void; + SetMashToEnable(isEnabled: boolean): void; + SetActivationUnlocksMouse(isEnabled: boolean): void; + SetHideOnLostFocus(isEnabled: boolean): void; +} + +interface CommandContext { + /** A reference to Cmdr. This may either be the server or client version of Cmdr depending on where the command is running. */ + Cmdr: Cmdr | CmdrClient; + /** The dispatcher that created this command. */ + Dispatcher: Dispatcher; + /** The name of the command. */ + Name: string; + /** The specific alias of this command that was used to trigger this command (may be the same as `Name`) */ + Alias: string; + /** The raw text that was used to trigger this command. */ + RawText: string; + /** The group this command is a part of. Defined in command definitions, typically a string. */ + Group: unknown; + /** A blank table that can be used to store user-defined information about this command's current execution. This could potentially be used with hooks to add information to this table which your command or other hooks could consume. */ + State: {}; + /** Any aliases that can be used to also trigger this command in addition to its name. */ + Aliases: Array; + /** The description for this command from the command definition. */ + Description: string; + /** The player who ran this command. */ + Executor: Player; + /** An array of strings which is the raw value for each argument. */ + RawArguments: Array; + /** An array of ArgumentContext objects, the parsed equivalent to RawArguments. */ + Arguments: Array; + /** The command output, if the command has already been run. Typically only accessible in the AfterRun hook. */ + Response: string | undefined; + /** Returns the ArgumentContext for the given index. */ + GetArgument(index: number): ArgumentContext; + /** Returns the command data that was sent along with the command. This is the return value of the Data function from the command definition. */ + GetData(): unknown; + /** Returns a table of the given name. Always returns the same table on subsequent calls. Useful for storing things like ban information. Same as `Registry.GetStore`. */ + GetStore(name: string): {}; + /** Sends a network event of the given name to the given player. See Network Event Handlers. */ + SendEvent(player: Player, event: string): void; + /** Broadcasts a network event to all players. See Network Event Handlers. */ + BroadcastEvent(event: string, ...args: Array): void; + /** Prints the given text in the user's console. Useful for when a command needs to print more than one message or is long-running. You should still `return` a string from the command implementation when you are finished, `Reply` should only be used to send additional messages before the final message. */ + Reply(text: string, color?: Color3): void; + /** Returns `true` if the command has an implementation on this machine. For example, this function will return `false` from the client if you call it on a command that only has a server-side implementation. Note that commands can potentially run on both the client and the server, so what this property returns on the server is not related to what it returns on the client, and vice versa. Likewise, receiving a return value of `true` on the client does not mean that the command won't run on the server, because Cmdr commands can run a first part on the client and a second part on the server. This function only answers one question if you run the command; does it run any code as a result of that on this machine? */ + HasImplementation(): boolean; +} + +interface Dispatcher { + /** + * **CLIENT ONLY** + * + * This should be used to invoke commands programmatically as the local player. Accepts a variable number of arguments, which are all joined with spaces before being run. This function will raise an error if any validations occur, since it's only for hard-coded (or generated) commands. + */ + Run(...names: Array): string; + /** Runs a command as the given player. If called on the client, only text is required. Returns output or error test as a string. */ + EvaluateAndRun( + commandText: string, + executor?: Player, + options?: { + Data: unknown; + IsHuman: boolean; + } + ): string; + /** + * **CLIENT ONLY** + * + * Returns an array of the user's command history. Most recent commands are inserted at the end of the array. + */ + GetHistory(): Array; +} + +interface TypeDefinition { + /** Optionally overrides the user-facing name of this type in the autocomplete menu. If omitted, the registered name of this type will be used. */ + DisplayName?: string; + /** String containing default [Prefixed Union Types](https://eryn.io/Cmdr/guide/Commands.html#prefixed-union-types) for this type. This property should omit the initial type name, so this string should begin with a prefix character, e.g. `Prefixes = "# integer ! boolean"`. */ + Prefixes?: string; + /** Transform is an optional function that is passed two values: the raw text, and the player running the command. Then, whatever values this function returns will be passed to all other functions in the type (`Validate`, `Autocomplete`, and `Parse`). */ + Transform?: (rawText: string, executor: Player) => unknown; + /** + * The `Validate` function is passed whatever is returned from the Transform function (or the raw value if there is no Transform function). If the value is valid for the type, it should return `true`. If it the value is invalid, it should return two values: false, and a string containing an error message. + * + * If this function isn't present, anything will be considered valid. + */ + Validate?: (value: unknown) => boolean | LuaTuple<[boolean, string]>; + /** + * This function works exactly the same as the normal `Validate` function, except it only runs once (after the user presses Enter). This should only be used if the validation process is relatively expensive or needs to yield. For example, the PlayerId type uses this because it needs to call `GetUserIdFromNameAsync` in order to validate. + * + * For the vast majority of types, you should just use `Validate` instead. + */ + ValidateOnce?: (value: unknown) => boolean | LuaTuple<[boolean, string]>; + /** Should only be present for types that are possible to be auto completed. It should return an array of strings that will be displayed in the auto complete menu. It can also return a second value, which can be a dictionary with options such as `IsPartial` as described above. */ + Autocomplete?: ( + value: unknown + ) => Array | LuaTuple<[Array, { IsPartial?: boolean }]>; + /** Parse is the only required function in a type definition. It is the final step before the value is considered finalized. This function should return the actual parsed value that will be sent to the command functions. */ + Parse: (value: unknown) => unknown; + /** The `Default` function is optional and should return the "default" value for this type, as a string. For example, the default value of the `players` type is the name of the player who ran the command. */ + Default?: (player: Player) => string; + /** + * If you set the optional key `Listable` to `true` in your table, this will tell Cmdr that comma-separated lists are allowed for this type. Cmdr will automatically split the list and parse each segment through your Transform, Validate, Autocomplete, and Parse functions individually, so you don't have to change the logic of your Type at all. + * + * The only limitation is that your Parse function **must return a table**. The tables from each individual segment's Parse will be merged into one table at the end of the parse step. The uniqueness of values is ensured upon merging, so even if the user lists the same value several times, it will only appear once in the final table. + */ + Listable?: boolean; +} + +interface CommandArgument { + /** The argument type (case sensitive), or an inline TypeDefinition object */ + Type: string | TypeDefinition; + /** The argument name, this is displayed to the user as they type. */ + Name: string; + /** A description of what the argument is, this is also displayed to the user. */ + Description: string; + /** If this is present and set to `true`, then the user can run the command without filling out this value. The argument will be sent to your commands as `nil`. */ + Optional?: boolean; + /** If present, the argument will be optional and if the user doesn't supply a value, your function will receive whatever you set this to. Default being set implies Optional = true, so Optional can be omitted. */ + Default?: unknown; +} + +interface CommandDefinition { + /** The name that's in auto complete and displayed to user. */ + Name: string; + /** Aliases that are not in the autocomplete, but if matched will run this command just the same. For example, `m` might be an alias of `announce`. */ + Aliases?: Array; + /** A description of the command which is displayed to the user. */ + Description: string; + /** Optional, can be be any value you wish. This property is intended to be used in hooks, so that you can categorize commands and decide if you want a specific user to be able to run them or not. */ + Group?: unknown; + /** Array of `CommandArgument` objects, or functions that return `CommandArgument` objects. */ + Args: Array CommandArgument)>; + /** If your command needs to gather some extra data from the client that's only available on the client, then you can define this function. It should accept the CommandContext for the current command as an argument, and return a single value which will be available in the command with [CommandContext.GetData](https://eryn.io/Cmdr/api/CommandContext.html#getdata). */ + Data?: (context: CommandContext, ...args: Array) => unknown; + /** + * If you want your command to run on the client, you can add this function to the command definition itself. It works exactly like the function that you would return from the Server module. + * + * * If this function returns a string, the command will run entirely on the client and won't touch the server (which means server-only hooks won't run). + * * If this function doesn't return anything, it will fall back to executing the Server module on the server. + * + * **WARNING** + * + * If this function is present and there isn't a Server module for this command, it is considered an error to not return a string from this function. */ + ClientRun?: ( + context: CommandContext, + ...args: Array + ) => string | undefined; + /** A list of commands to run automatically when this command is registered at the start of the game. This should primarily be used to register any aliases regarding this command with the built-in `alias` command, but can be used for initializing state as well. Command execution will be deferred until the end of the frame. */ + AutoExec?: Array; +} + +interface Registry { + /** + * **SERVER ONLY** + * + * Registers all types from within a container. + */ + RegisterTypesIn(container: Instance): void; + /** Registers a type. This function should be called from within the type definition ModuleScript. */ + RegisterType(name: string, typeDefinition: TypeDefinition): void; + /** Registers a [Prefixed Union Type](https://eryn.io/Cmdr/guide/Commands.html#prefixed-union-types) string for the given type. If there are already type prefixes for the given type name, they will be **concatenated**. This allows you to contribute prefixes for default types, like `players`. */ + RegisterTypePrefix(name: string, union: string): void; + /** Allows you to register a name which will be expanded into a longer type which will can be used as command argument types. For example, if you register the alias `"stringOrNumber"` it could be interpreted as `"string # number"` when used. */ + RegisterTypeAlias(name: string, union: string): void; + /** Returns a type definition with the given name, or nil if it doesn't exist. */ + GetType(name: string): TypeDefinition | undefined; + /** Returns a type name taking aliases into account. If there is no alias, the name parameter is simply returned as a pass through. */ + GetTypeName(name: string): string; + /** + * **SERVER ONLY** + * + * Registers all hooks from within a container on both the server and the client. If you want to add a hook to the server or the client only (not on both), then you should use the [Registry.RegisterHook](https://eryn.io/Cmdr/api/Registry.html#registerhook) method directly by requiring Cmdr in a server or client script. + */ + RegisterHooksIn(container: Instance): void; + /** + * **SERVER ONLY** + * + * Registers all commands from within a container. + */ + RegisterCommandsIn( + container: Instance, + filter?: (command: CommandDefinition) => boolean + ): void; + /** + * **SERVER ONLY** + * + * Registers an individual command directly from a module script and possible server script. For most cases, you should use [Registry.RegisterCommandsIn](https://eryn.io/Cmdr/api/Registry.html#registercommandsin) instead. + */ + RegisterCommand( + commandScript: ModuleScript, + commandServerScript?: ModuleScript, + filter?: (command: CommandDefinition) => boolean + ): void; + /** Registers the default set of commands. */ + RegisterDefaultCommands(): void; + RegisterDefaultCommands(groups: Array): void; + RegisterDefaultCommands( + filter: (command: CommandDefinition) => boolean + ): void; + /** Returns the CommandDefinition of the given name, or nil if not registered. Command aliases are also accepted. */ + GetCommand(name: string): CommandDefinition | undefined; + /** Returns an array of all commands (aliases not included). */ + GetCommands(): Array; + /** Returns an array of all command names. */ + GetCommandNames(): Array; + /** Adds a hook. This should probably be run on the server, but can also work on the client. Hooks run in order of priority (lower number runs first). */ + RegisterHook( + hookName: 'BeforeRun' | 'AfterRun', + callback: (context: CommandContext) => string | undefined, + priority?: number + ): void; + /** Returns a table saved with the given name. This is the same as [CommandContext.GetStore](https://eryn.io/Cmdr/api/CommandContext.html#getstore) */ + GetStore(name: string): unknown; + Cmdr: Cmdr; +} + +/** Any object with a `Name` property. */ +interface NamedObject { + Name: string; +} + +interface Util { + /** Accepts an array and flips it into a dictionary, its values becoming keys in the dictionary with the value of `true`. */ + MakeDictionary: (array: Array) => Map; + /** Maps values from one array to a new array. Passes each value through the given callback and uses its return value in the same position in the new array. */ + Map: ( + array: Array, + mapper: (value: T, index: number) => U + ) => Array; + /** Maps arguments #2-n through callback and returns all values as tuple. */ + Each: ( + mapper: (value: T) => U, + ...values: Array + ) => LuaTuple>; + /** Makes a fuzzy finder for the given set or container. You can pass an array of strings, array of instances, array of EnumItems, array of dictionaries with a Name key or an instance (in which case its children will be used). */ + MakeFuzzyFinder: ( + set: + | Array + | Array + | Array + | Array + | Instance + ) => (text: string, returnFirst?: boolean) => unknown; + /** Accepts an array of instances (or anything with a Name property) and maps them into an array of their names. */ + GetNames: (instances: Array) => Array; + /** Splits a string into an array split by the given separator. */ + SplitStringSimple: (text: string, separator: string) => Array; + /** Splits a string by spaces, but taking double-quoted sequences into account which will be treated as a single value. */ + SplitString: (text: string, max?: number) => Array; + /** Trims whitespace from both sides of a string. */ + TrimString: (text: string) => string; + /** Returns the text bounds size as a Vector2 based on the given label and optional display size. If size is omitted, the absolute width is used. */ + GetTextSize: (text: string, label: TextLabel, size?: Vector2) => Vector2; + /** Makes an Enum type out of a name and an array of strings. See Enum Values. */ + MakeEnumType: ( + type: string, + values: Array + ) => TypeDefinition; + /** Takes a singular type and produces a plural (listable) type out of it. */ + MakeListableType: ( + type: TypeDefinition, + override: Map + ) => TypeDefinition; + /** + * A helper function that makes a type which contains a sequence, like Vector3 or Color3. The delimeter can be either `,` or whitespace, checking `,` first. options is a table that can contain: + * + * * `TransformEach`: a function that is run on each member of the sequence, transforming it individually. + * * `ValidateEach`: a function is run on each member of the sequence validating it. It is passed the value and the index at which it occurs in the sequence. It should return true if it is valid, or false and a string reason if it is not. + * + * And one of: + * + * * `Parse`: A function that parses all of the values into a single type. + * * `Constructor`: A function that expects the values unpacked as parameters to create the parsed object. This is a shorthand that allows you to set Constructor directly to Vector3.new, for example. + */ + MakeSequenceType: ( + options: { + TransformEach: Callback; + ValidateEach: Callback; + } & ( + | { + Parse: Callback; + } + | { + Constructor: Callback; + } + ) + ) => void; + /** Splits a string by a single delimeter chosen from the given set. The first matching delimeter from the set becomes the split character. */ + SplitPrioritizedDelimeter: ( + text: string, + delimters: Array + ) => Array; + /** Accepts a string with arguments (such as $1, $2, $3, etc) and a table or function to use with string.gsub. Returns a string with arguments replaced with their values. */ + SubstituteArgs: ( + text: string, + replace: + | Array + | Map + | ((variable: string) => string) + ) => string; + /** Accepts the current dispatcher and a command string. Parses embedded commands from within the string, evaluating to the output of the command when run with `dispatcher:EvaluateAndRun`. Returns the response string. */ + RunEmbeddedCommands: ( + dispatcher: Dispatcher, + commandString: string + ) => string; + /** Returns a string emulating `\t` tab stops with spaces. */ + EmulateTabstops: (text: string, tabWidth: number) => string; + /** Replaces escape sequences with their fully qualified characters in a string. This only parses `\n`, `\t`, `\uXXXX`, and `\xXX` where `X` is any hexadecimal character. */ + ParseEscapeSequences: (text: string) => string; +} + +declare const Cmdr: Cmdr; +declare const CmdrClient: CmdrClient; +export { + ArgumentContext, + Cmdr, + CmdrClient, + CommandContext, + Dispatcher, + TypeDefinition, + CommandArgument, + CommandDefinition, + Registry, + NamedObject, + Util, +}; diff --git a/src/collectionserviceutils/index.d.ts b/src/collectionserviceutils/index.d.ts new file mode 100644 index 00000000000..1a654233a7c --- /dev/null +++ b/src/collectionserviceutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxCollectionServiceUtils'; +export * from './src/Shared/CollectionServiceUtils'; diff --git a/src/collectionserviceutils/src/Shared/CollectionServiceUtils.d.ts b/src/collectionserviceutils/src/Shared/CollectionServiceUtils.d.ts new file mode 100644 index 00000000000..3ebe8a9a390 --- /dev/null +++ b/src/collectionserviceutils/src/Shared/CollectionServiceUtils.d.ts @@ -0,0 +1,11 @@ +export namespace CollectionServiceUtils { + function findFirstAncestor( + tagName: string, + child: Instance + ): Instance | undefined; + function findInstanceOrFirstAncestor( + tagName: string, + child: Instance + ): Instance | undefined; + function removeAllTags(instance: Instance): void; +} diff --git a/src/collectionserviceutils/src/Shared/RxCollectionServiceUtils.d.ts b/src/collectionserviceutils/src/Shared/RxCollectionServiceUtils.d.ts new file mode 100644 index 00000000000..49495e58adc --- /dev/null +++ b/src/collectionserviceutils/src/Shared/RxCollectionServiceUtils.d.ts @@ -0,0 +1,7 @@ +import { Brio } from '../../../brio'; +import { Observable } from '../../../rx'; + +export namespace RxCollectionServiceUtils { + function observeTaggedBrio(tagName: string): Observable>; + function observeTagged(tagName: string): Observable; +} diff --git a/src/color3serializationutils/index.d.ts b/src/color3serializationutils/index.d.ts new file mode 100644 index 00000000000..0aef52059aa --- /dev/null +++ b/src/color3serializationutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Color3SerializationUtils'; diff --git a/src/color3serializationutils/src/Shared/Color3SerializationUtils.d.ts b/src/color3serializationutils/src/Shared/Color3SerializationUtils.d.ts new file mode 100644 index 00000000000..32e7dc10bb1 --- /dev/null +++ b/src/color3serializationutils/src/Shared/Color3SerializationUtils.d.ts @@ -0,0 +1,10 @@ +export type SerializedColor3 = [r: number, g: number, b: number] & { + __brand: 'SerializedColor3'; +}; + +export namespace Color3SerializationUtils { + function serialize(color3: Color3): SerializedColor3; + function isSerializedColor3(value: unknown): value is SerializedColor3; + function fromRGB(r: number, g: number, b: number): SerializedColor3; + function deserialize(serializedColor3: SerializedColor3): Color3; +} diff --git a/src/color3utils/index.d.ts b/src/color3utils/index.d.ts new file mode 100644 index 00000000000..f014ffd41ac --- /dev/null +++ b/src/color3utils/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Shared/Color3Utils'; +export * from './src/Shared/luv/LuvColor3Utils'; +export * from './src/Shared/luv/LuvUtils'; +export * from './src/Shared/luv/LuvVectorColor3Utils'; diff --git a/src/color3utils/src/Shared/Color3Utils.d.ts b/src/color3utils/src/Shared/Color3Utils.d.ts new file mode 100644 index 00000000000..3e0be998c16 --- /dev/null +++ b/src/color3utils/src/Shared/Color3Utils.d.ts @@ -0,0 +1,13 @@ +export namespace Color3Utils { + function getRelativeLuminance(color: Color3): number; + function textShouldBeBlack(color: Color3): boolean; + function scaleValue(color: Color3, percent: number): Color3; + function setValue(color: Color3, value: number): Color3; + function setHue(color: Color3, hue: number): Color3; + function scaleSaturation(color: Color3, percent: number): Color3; + function setSaturation(color: Color3, saturation: number): Color3; + function areEqual(a: Color3, b: Color3, epsilon?: number): boolean; + function toHexInteger(color: Color3): number; + function toHexString(color: Color3): string; + function toWebHexString(color: Color3): string; +} diff --git a/src/color3utils/src/Shared/luv/LuvColor3Utils.d.ts b/src/color3utils/src/Shared/luv/LuvColor3Utils.d.ts new file mode 100644 index 00000000000..d20c1167969 --- /dev/null +++ b/src/color3utils/src/Shared/luv/LuvColor3Utils.d.ts @@ -0,0 +1,9 @@ +type LuvColor3 = [l: number, u: number, v: number]; + +export namespace LuvColor3Utils { + function lerp(a: Color3, b: Color3, t: number): Color3; + function desaturate(color3: Color3, proportion: number): Color3; + function darken(color3: Color3, proportion: number): Color3; + function fromColor3(color3: Color3): LuvColor3; + function toColor3(luv: LuvColor3): Color3; +} diff --git a/src/color3utils/src/Shared/luv/LuvUtils.d.ts b/src/color3utils/src/Shared/luv/LuvUtils.d.ts new file mode 100644 index 00000000000..88d2fb3fed8 --- /dev/null +++ b/src/color3utils/src/Shared/luv/LuvUtils.d.ts @@ -0,0 +1,47 @@ +import { LuvColor3 } from './LuvColor3Utils'; + +type Line = { + slope: number; + intercept: number; +}; + +export namespace LuvUtils { + const m: [LuvColor3, LuvColor3, LuvColor3]; + const minv: [LuvColor3, LuvColor3, LuvColor3]; + const refY: 1.0; + const refU: 0.19783000664283; + const refV: 0.46831999493879; + const kappa: 903.2962962; + const epsilon: 0.0088564516; + + function get_bounds(l: number): Line[]; + function max_safe_chroma_for_l(l: number): number; + function max_safe_chroma_for_lh(l: number, h: number): number; + function dot_product(a: LuvColor3, b: LuvColor3): number; + function from_linear(c: number): number; + function to_linear(c: number): number; + function xyz_to_rgb(luvColor3: LuvColor3): LuvColor3; + function rgb_to_xyz(luvColor3: LuvColor3): LuvColor3; + function y_to_l(y: number): number; + function l_to_y(l: number): number; + function xyz_to_luv(luvColor3: LuvColor3): LuvColor3; + function luv_to_xyz(luvColor3: LuvColor3): LuvColor3; + function luv_to_lch(luvColor3: LuvColor3): LuvColor3; + function lch_to_luv(luvColor3: LuvColor3): LuvColor3; + function hsluv_to_lch(luvColor3: LuvColor3): LuvColor3; + function lch_to_hsluv(luvColor3: LuvColor3): LuvColor3; + function hpluv_to_lch(luvColor3: LuvColor3): LuvColor3; + function lch_to_hpluv(luvColor3: LuvColor3): LuvColor3; + function rgb_to_hex(luvColor3: LuvColor3): string; + function hex_to_rgb(hex: string): LuvColor3; + function lch_to_rgb(luvColor3: LuvColor3): LuvColor3; + function rgb_to_lch(luvColor3: LuvColor3): LuvColor3; + function hsluv_to_rgb(luvColor3: LuvColor3): LuvColor3; + function rgb_to_hsluv(luvColor3: LuvColor3): LuvColor3; + function hpluv_to_rgb(luvColor3: LuvColor3): LuvColor3; + function rgb_to_hpluv(luvColor3: LuvColor3): LuvColor3; + function hsluv_to_hex(luvColor3: LuvColor3): string; + function hpluv_to_hex(luvColor3: LuvColor3): string; + function hex_to_hsluv(hex: string): LuvColor3; + function hex_to_hpluv(hex: string): LuvColor3; +} diff --git a/src/color3utils/src/Shared/luv/LuvVectorColor3Utils.d.ts b/src/color3utils/src/Shared/luv/LuvVectorColor3Utils.d.ts new file mode 100644 index 00000000000..21018c11a10 --- /dev/null +++ b/src/color3utils/src/Shared/luv/LuvVectorColor3Utils.d.ts @@ -0,0 +1,4 @@ +export namespace LuvVectorColor3Utils { + function fromColor3(color3: Color3): Vector3; + function toColor3(luvV3: Vector3): Color3; +} diff --git a/src/colorpalette/index.d.ts b/src/colorpalette/index.d.ts new file mode 100644 index 00000000000..19d0aecca4c --- /dev/null +++ b/src/colorpalette/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Shared/ColorPalette'; +export * from './src/Shared/Font/FontPalette'; +export * from './src/Shared/Grade/ColorGradePalette'; +export * from './src/Shared/Grade/ColorGradeUtils'; +export * from './src/Shared/Swatch/ColorSwatch'; diff --git a/src/colorpalette/src/Shared/ColorPalette.d.ts b/src/colorpalette/src/Shared/ColorPalette.d.ts new file mode 100644 index 00000000000..ef2a08c1e20 --- /dev/null +++ b/src/colorpalette/src/Shared/ColorPalette.d.ts @@ -0,0 +1,63 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ToPropertyObservableArgument } from '@quenty/blend'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { Mountable, ValueObject } from '@quenty/valueobject'; +import { ColorGradePalette } from './Grade/ColorGradePalette'; +import { ColorSwatch } from './Swatch/ColorSwatch'; + +interface ColorPalette extends BaseObject { + ColorSwatchAdded: Signal; + ColorGradeAdded: Signal; + GetSwatchNames(): string[]; + ObserveSwatchNames(): Observable; + ObserveSwatchNameList(): Observable; + ObserveSwatchNamesBrio(): Observable>; + GetGradeNames(): string[]; + ObserveGradeNameList(): Observable; + ObserveGradeNames(): Observable; + ObserveGradeNamesBrio(): Observable>; + GetColorValues(): Readonly>>; + GetColor( + color: string | Color3 | Color3Value, + grade?: string | number, + vividness?: string | number + ): Color3; + ObserveColor( + color: string | Color3 | ToPropertyObservableArgument, + grade?: string | number | ToPropertyObservableArgument, + vividness?: string | number | ToPropertyObservableArgument + ): Observable; + SetDefaultSurfaceName(surfaceName: string): void; + GetColorSwatch(colorName: string): string; + ObserveOn: ColorGradePalette['ObserveOn']; + GetColorValue(colorName: string): ValueObject; + GetGradeValue(): ValueObject; + GetVividnessValue(): ValueObject; + ObserveModifiedGrade: ColorGradePalette['ObserveModified']; + ObserveGrade: ColorGradePalette['ObserveGrade']; + ObserveVividness: ColorGradePalette['ObserveVividness']; + GetSwatch(swatchName: string): ColorSwatch; + SetColor(colorName: string, color: Mountable): void; + SetVividness(gradeName: string, vividness: Mountable): void; + SetColorGrade(gradeName: string, colorGrade: Mountable): void; + ObserveColorBaseGradeBetween( + colorName: string, + low: number, + high: number + ): Observable; + DefineColorGrade( + gradeName: string, + gradeValue?: Mountable, + vividness?: Mountable + ): ValueObject; + DefineColorSwatch(colorName: string, value?: Color3): ColorSwatch; +} + +interface ColorPaletteConstructor { + readonly ClassName: 'ColorPalette'; + new (): ColorPalette; +} + +export const ColorPalette: ColorPaletteConstructor; diff --git a/src/colorpalette/src/Shared/Font/FontPalette.d.ts b/src/colorpalette/src/Shared/Font/FontPalette.d.ts new file mode 100644 index 00000000000..abc7b7db0cd --- /dev/null +++ b/src/colorpalette/src/Shared/Font/FontPalette.d.ts @@ -0,0 +1,33 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface FontPalette extends BaseObject { + FontAdded: Signal; + GetFontNames(): string[]; + ObserveFontNames(): Observable; + ObserveFontNamesBrio(): Observable>; + GetFont(fontName: string): Enum.Font; + ObserveFont(fontName: string): Observable; + ObserveFontFace( + fontName: string, + weight?: Enum.FontWeight | Observable, + style?: Enum.FontStyle | Observable + ): Observable; + GetFontFaceValue(fontName: string): ValueObject; + GetFontValue(fontName: string): ValueObject; + GetDefaultFontMap(): Record; + DefineFont( + fontName: string, + defaultFont: Enum.Font | Font + ): ValueObject | undefined; +} + +interface FontPaletteConstructor { + readonly ClassName: 'FontPalette'; + new (): FontPalette; +} + +export const FontPalette: FontPaletteConstructor; diff --git a/src/colorpalette/src/Shared/Grade/ColorGradePalette.d.ts b/src/colorpalette/src/Shared/Grade/ColorGradePalette.d.ts new file mode 100644 index 00000000000..f3ce251662c --- /dev/null +++ b/src/colorpalette/src/Shared/Grade/ColorGradePalette.d.ts @@ -0,0 +1,38 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ToPropertyObservableArgument } from '@quenty/blend'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface ColorGradePalette extends BaseObject { + SetDefaultSurfaceName(gradeName: string): void; + HasGrade(gradeName: string): boolean; + GetGrade(gradeName: string): LuaTuple<[grade: number, vividness: number]>; + GetVividness(gradeName: string): number; + Add( + gradeName: string, + colorGrade: number | ToPropertyObservableArgument, + vividness: ToPropertyObservableArgument + ): void; + ObserveGrade(gradeName: string): Observable; + ObserveVividness(gradeName: string): Observable; + ObserveModified( + gradeName: string, + amount: number | Color3 | Observable | string, + multiplier?: number | Observable + ): Observable; + ObserveOn( + gradeName: string, + newSurfaceName: number | Color3 | Observable | string, + baseSurfaceName?: number | Color3 | Observable | string + ): LuaTuple<[finalGrade: Observable, vividness: Observable]>; + ObserveDefaultSurfaceGrade(): Observable; +} + +interface ColorGradePaletteConstructor { + readonly ClassName: 'ColorGradePalette'; + new (): ColorGradePalette; +} + +export const ColorGradePalette: ColorGradePaletteConstructor; diff --git a/src/colorpalette/src/Shared/Grade/ColorGradeUtils.d.ts b/src/colorpalette/src/Shared/Grade/ColorGradeUtils.d.ts new file mode 100644 index 00000000000..834cbed6319 --- /dev/null +++ b/src/colorpalette/src/Shared/Grade/ColorGradeUtils.d.ts @@ -0,0 +1,15 @@ +export namespace ColorGradeUtils { + function addGrade(grade: number, difference: number): number; + function addGradeToColor(color: Color3, difference: number): Color3; + function ensureGradeContrast( + color: Color3, + backing: Color3, + amount: number + ): Color3; + function getGrade(color: Color3): number; + function getGradedColor( + baseColor: Color3, + colorGrade: number, + vididness?: number + ): Color3; +} diff --git a/src/colorpalette/src/Shared/Swatch/ColorSwatch.d.ts b/src/colorpalette/src/Shared/Swatch/ColorSwatch.d.ts new file mode 100644 index 00000000000..ca259b00ec9 --- /dev/null +++ b/src/colorpalette/src/Shared/Swatch/ColorSwatch.d.ts @@ -0,0 +1,32 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ToPropertyObservableArgument } from '@quenty/blend'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { Mountable } from '@quenty/valueobject'; + +interface ColorSwatch extends BaseObject { + Changed: Signal; + GetGraded(colorGrade: number): Color3; + ObserveGraded( + colorGrade: number | Observable, + vividness?: number | ToPropertyObservableArgument + ): Observable; + ObserveBaseColor(): Observable; + ObserveVividness(): Observable; + GetBaseColor(): Color3; + GetBaseGrade(): number; + ObserveBaseGrade(): Observable; + ObserveBaseGradeBetween(low: number, high: number): Observable; + GetVividness(): number; + SetVividness( + vividness: number | ToPropertyObservableArgument | undefined + ): void; + SetBaseColor(color: Mountable): void; +} + +interface ColorSwatchConstructor { + readonly ClassName: 'ColorSwatch'; + new (color: Mountable, vividness?: number): ColorSwatch; +} + +export const ColorSwatch: ColorSwatchConstructor; diff --git a/src/colorpicker/index.d.ts b/src/colorpicker/index.d.ts new file mode 100644 index 00000000000..3929120997b --- /dev/null +++ b/src/colorpicker/index.d.ts @@ -0,0 +1,8 @@ +export * from './src/Client/ColorPickerUtils'; +export * from './src/Client/Cursor/ColorPickerCursorPreview'; +export * from './src/Client/Cursor/ColorPickerTriangle'; +export * from './src/Client/Cursor/HSColorPickerCursor'; +export * from './src/Client/HSV/HSColorPicker'; +export * from './src/Client/HSV/HSVColorPicker'; +export * from './src/Client/HSV/ValueColorPicker'; +export * from './src/Client/Story/ColorPickerStoryUtils'; diff --git a/src/colorpicker/src/Client/ColorPickerUtils.d.ts b/src/colorpicker/src/Client/ColorPickerUtils.d.ts new file mode 100644 index 00000000000..3ac500c0173 --- /dev/null +++ b/src/colorpicker/src/Client/ColorPickerUtils.d.ts @@ -0,0 +1,3 @@ +export namespace ColorPickerUtils { + function getOutlineWithContrast(color: Color3, backingColor: Color3): Color3; +} diff --git a/src/colorpicker/src/Client/Cursor/ColorPickerCursorPreview.d.ts b/src/colorpicker/src/Client/Cursor/ColorPickerCursorPreview.d.ts new file mode 100644 index 00000000000..849259f2ccf --- /dev/null +++ b/src/colorpicker/src/Client/Cursor/ColorPickerCursorPreview.d.ts @@ -0,0 +1,19 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Signal } from '@quenty/signal'; + +interface ColorPickerCursorPreview extends BasicPane { + PositionChanged: Signal; + Gui: Frame; + HintBackgroundColor(color: Color3): void; + SetPosition(position: Vector2): void; + GetPosition(): Vector2; + SetColor(color: Color3): void; + SetTransparency(transparency: number): void; +} + +interface ColorPickerCursorPreviewConstructor { + readonly ClassName: 'ColorPickerCursorPreview'; + new (): ColorPickerCursorPreview; +} + +export const ColorPickerCursorPreview: ColorPickerCursorPreviewConstructor; diff --git a/src/colorpicker/src/Client/Cursor/ColorPickerTriangle.d.ts b/src/colorpicker/src/Client/Cursor/ColorPickerTriangle.d.ts new file mode 100644 index 00000000000..2dda8850d20 --- /dev/null +++ b/src/colorpicker/src/Client/Cursor/ColorPickerTriangle.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ValueObject } from '@quenty/valueobject'; + +interface ColorPickerTriangle extends BaseObject { + Gui: Frame; + HintBackgroundColor(color: Color3): void; + GetSizeValue(): ValueObject; + GetMeasureValue(): ValueObject; + SetColor(color: Color3): void; + SetTransparency(transparency: number): void; +} + +interface ColorPickerTriangleConstructor { + readonly ClassName: 'ColorPickerTriangle'; + new (): ColorPickerTriangle; +} + +export const ColorPickerTriangle: ColorPickerTriangleConstructor; diff --git a/src/colorpicker/src/Client/Cursor/HSColorPickerCursor.d.ts b/src/colorpicker/src/Client/Cursor/HSColorPickerCursor.d.ts new file mode 100644 index 00000000000..57f2a9186c5 --- /dev/null +++ b/src/colorpicker/src/Client/Cursor/HSColorPickerCursor.d.ts @@ -0,0 +1,21 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; + +interface HSColorPickerCursor extends BaseObject { + PositionChanged: Signal; + Gui: Frame; + HintBackgroundColor(color: Color3): void; + SetVerticalHairVisible(visible: boolean): void; + SetHorizontalHairVisible(visible: boolean): void; + SetHeight(height: number): void; + SetPosition(position: Vector2): void; + GetPosition(): Vector2; + SetTransparency(transparency: number): void; +} + +interface HSColorPickerCursorConstructor { + readonly ClassName: 'HSColorPickerCursor'; + new (): HSColorPickerCursor; +} + +export const HSColorPickerCursor: HSColorPickerCursorConstructor; diff --git a/src/colorpicker/src/Client/HSV/HSColorPicker.d.ts b/src/colorpicker/src/Client/HSV/HSColorPicker.d.ts new file mode 100644 index 00000000000..943fbd93a90 --- /dev/null +++ b/src/colorpicker/src/Client/HSV/HSColorPicker.d.ts @@ -0,0 +1,25 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface HSColorPicker extends BaseObject { + Gui: Frame; + ColorChanged: Signal; + ObserveIsPressed(): Observable; + SetHSVColor(hsvColor: Vector3): void; + GetHSVColor(): Vector3; + SetColor(color: Color3): void; + GetColor(): Color3; + GetSizeValue(): ValueObject; + GetMeasureValue(): ValueObject; + SetTransparency(transparency: number): void; + SetSize(height: number): void; +} + +interface HSColorPickerConstructor { + readonly ClassName: 'HSColorPicker'; + new (): HSColorPicker; +} + +export const HSColorPicker: HSColorPickerConstructor; diff --git a/src/colorpicker/src/Client/HSV/HSVColorPicker.d.ts b/src/colorpicker/src/Client/HSV/HSVColorPicker.d.ts new file mode 100644 index 00000000000..d96830ea231 --- /dev/null +++ b/src/colorpicker/src/Client/HSV/HSVColorPicker.d.ts @@ -0,0 +1,26 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Maid } from '@quenty/maid'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface HSVColorPicker extends BaseObject { + Gui: Frame; + ColorChanged: Signal; + SetSize(height: number): void; + SyncValue(color3Value: Color3Value): Maid; + HintBackgroundColor(color: Color3): void; + SetHSVColor(hsvColor: Vector3): void; + GetHSVColor(): Vector3; + SetColor(color: Color3): void; + GetColor(): Color3; + GetSizeValue(): ValueObject; + GetMeasureValue(): ValueObject; + SetTransparency(transparency: number): void; +} + +interface HSVColorPickerConstructor { + readonly ClassName: 'HSVColorPicker'; + new (): HSVColorPicker; +} + +export const HSVColorPicker: HSVColorPickerConstructor; diff --git a/src/colorpicker/src/Client/HSV/ValueColorPicker.d.ts b/src/colorpicker/src/Client/HSV/ValueColorPicker.d.ts new file mode 100644 index 00000000000..2dea89586b6 --- /dev/null +++ b/src/colorpicker/src/Client/HSV/ValueColorPicker.d.ts @@ -0,0 +1,26 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface ValueColorPicker extends BaseObject { + Gui: Frame; + ColorChanged: Signal; + SetSize(height: number): void; + HintBackgroundColor(color: Color3): void; + ObserveIsPressed(): Observable; + SetHSVColor(hsvColor: Vector3): void; + GetHSVColor(): Vector3; + SetColor(color: Color3): void; + GetColor(): Color3; + GetSizeValue(): ValueObject; + GetMeasureValue(): ValueObject; + SetTransparency(transparency: number): void; +} + +interface ValueColorPickerConstructor { + readonly ClassName: 'ValueColorPicker'; + new (): ValueColorPicker; +} + +export const ValueColorPicker: ValueColorPickerConstructor; diff --git a/src/colorpicker/src/Client/Story/ColorPickerStoryUtils.d.ts b/src/colorpicker/src/Client/Story/ColorPickerStoryUtils.d.ts new file mode 100644 index 00000000000..38259e9c4a1 --- /dev/null +++ b/src/colorpicker/src/Client/Story/ColorPickerStoryUtils.d.ts @@ -0,0 +1,19 @@ +import { Maid } from '@quenty/maid'; +import { ValueObject } from '@quenty/valueobject'; +import { HSVColorPicker } from '../HSV/HSVColorPicker'; +import { Blend } from '@quenty/blend'; + +export namespace ColorPickerStoryUtils { + function createPicker( + maid: Maid, + valueSync: Color3Value, + labelText: string, + currentVisible: ValueObject + ): ReturnType>; + function create( + maid: Maid, + buildPickers: ( + callback: (labelText: string, valueSync: Color3Value) => void + ) => void + ): ReturnType>; +} diff --git a/src/colorsequenceutils/index.d.ts b/src/colorsequenceutils/index.d.ts new file mode 100644 index 00000000000..d24b445fbdc --- /dev/null +++ b/src/colorsequenceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ColorSequenceUtils'; diff --git a/src/colorsequenceutils/src/Shared/ColorSequenceUtils.d.ts b/src/colorsequenceutils/src/Shared/ColorSequenceUtils.d.ts new file mode 100644 index 00000000000..b37168261cd --- /dev/null +++ b/src/colorsequenceutils/src/Shared/ColorSequenceUtils.d.ts @@ -0,0 +1,10 @@ +export namespace ColorSequenceUtils { + function getColor(colorSequence: ColorSequence, t: number): Color3; + function stripe( + stripes: number, + backgroundColor3: Color3, + stripeColor3: Color3, + percentStripeThickness?: number, + percentOffset?: number + ): ColorSequence; +} diff --git a/src/conditions/index.d.ts b/src/conditions/index.d.ts new file mode 100644 index 00000000000..934de091ac2 --- /dev/null +++ b/src/conditions/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/AdorneeConditionUtils'; diff --git a/src/conditions/src/Shared/AdorneeConditionUtils.d.ts b/src/conditions/src/Shared/AdorneeConditionUtils.d.ts new file mode 100644 index 00000000000..4e01a528dd8 --- /dev/null +++ b/src/conditions/src/Shared/AdorneeConditionUtils.d.ts @@ -0,0 +1,37 @@ +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +export namespace AdorneeConditionUtils { + function observeConditionsMet( + conditionObj: BindableFunction, + adornee: Instance + ): Observable; + function promiseQueryConditionsMet( + conditionObj: BindableFunction, + adornee: Instance, + cancelToken?: CancelToken + ): Promise; + function createConditionContainer(): BindableFunction; + function create(observeCallback: () => boolean): BindableFunction; + function createRequiredProperty( + propertyName: string, + requiredValue: unknown + ): BindableFunction; + function createRequiredAttribute( + attributeName: string, + attributeValue: unknown + ): BindableFunction; + function createRequiredTieInterface( + tieInterfaceDefinition: unknown + ): BindableFunction; + function createOrConditionGroup(): BindableFunction; + function createAndConditionGroup(): BindableFunction; + function getRequiredTag(): string; + function getConditionNamePostfix(): string; + function setValueWhenEmpty(container: BindableFunction, value: boolean): void; + function getValueWhenEmpty(container: BindableFunction): boolean; + function observeValueWhenEmpty( + container: BindableFunction + ): Observable; +} diff --git a/src/contentproviderutils/index.d.ts b/src/contentproviderutils/index.d.ts new file mode 100644 index 00000000000..7108120ffe2 --- /dev/null +++ b/src/contentproviderutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/ContentProviderUtils'; +export * from './src/Client/ImageLabelLoaded'; diff --git a/src/contentproviderutils/src/Client/ContentProviderUtils.d.ts b/src/contentproviderutils/src/Client/ContentProviderUtils.d.ts new file mode 100644 index 00000000000..665d0c96862 --- /dev/null +++ b/src/contentproviderutils/src/Client/ContentProviderUtils.d.ts @@ -0,0 +1,5 @@ +import { Promise } from '@quenty/promise'; + +export namespace ContentProviderUtils { + function promisePreload(contentIdList: (Instance | string)[]): Promise; +} diff --git a/src/contentproviderutils/src/Client/ImageLabelLoaded.d.ts b/src/contentproviderutils/src/Client/ImageLabelLoaded.d.ts new file mode 100644 index 00000000000..fd40be2131b --- /dev/null +++ b/src/contentproviderutils/src/Client/ImageLabelLoaded.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Signal } from '@quenty/signal'; + +interface ImageLabelLoaded extends BaseObject { + ImageChanged: Signal; + + SetDefaultTimeout(defaultTimeout?: number): void; + SetPreloadImage(preloadImage: boolean): void; + PromiseLoaded(timeout?: number): Promise; + SetImageLabel(imageLabel?: ImageLabel): void; +} + +interface ImageLabelLoadedConstructor { + readonly ClassName: 'ImageLabelLoaded'; + new (): ImageLabelLoaded; +} + +export const ImageLabelLoaded: ImageLabelLoadedConstructor; diff --git a/src/convexhull/index.d.ts b/src/convexhull/index.d.ts new file mode 100644 index 00000000000..a09d13c8a46 --- /dev/null +++ b/src/convexhull/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/ConvexHull2DUtils'; +export * from './src/Shared/ConvexHull3DUtils'; diff --git a/src/convexhull/src/Shared/ConvexHull2DUtils.d.ts b/src/convexhull/src/Shared/ConvexHull2DUtils.d.ts new file mode 100644 index 00000000000..3aa65f2b44c --- /dev/null +++ b/src/convexhull/src/Shared/ConvexHull2DUtils.d.ts @@ -0,0 +1,17 @@ +export namespace ConvexHull2DUtils { + function convexHull(points: Vector2[]): Vector2[]; + function isClockWiseTurn(p1: Vector2, p2: Vector2, p3: Vector2): boolean; + function lineIntersect( + a: Vector2, + b: Vector2, + c: Vector2, + d: Vector2 + ): Vector2 | undefined; + function raycast( + from: Vector2, + to: Vector2, + hull: Vector2[] + ): LuaTuple< + [point: Vector2 | undefined, startPoint: Vector2, finishPoint: Vector2] + >; +} diff --git a/src/convexhull/src/Shared/ConvexHull3DUtils.d.ts b/src/convexhull/src/Shared/ConvexHull3DUtils.d.ts new file mode 100644 index 00000000000..7e18a09ce62 --- /dev/null +++ b/src/convexhull/src/Shared/ConvexHull3DUtils.d.ts @@ -0,0 +1,4 @@ +export namespace ConvexHull3DUtils { + function convexHull(points: Vector3[]): Vector3[]; + function drawVertices(points: Vector3[], color?: Color3): Folder; +} diff --git a/src/cooldown/index.d.ts b/src/cooldown/index.d.ts new file mode 100644 index 00000000000..4f14dc734b2 --- /dev/null +++ b/src/cooldown/index.d.ts @@ -0,0 +1,12 @@ +export * from './src/Client/Binders/CooldownClient'; +export * from './src/Client/CooldownServiceClient'; +export * from './src/Server/Binders/Cooldown'; +export * from './src/Server/CooldownService'; +export * from './src/Shared/Binders/CooldownBase'; +export * from './src/Shared/Binders/CooldownShared'; +export * from './src/Shared/CooldownConstants'; +export * from './src/Shared/CooldownUtils'; +export * from './src/Shared/Model/CooldownModel'; +export * from './src/Shared/Model/CooldownTrackerModel'; +export * from './src/Shared/RxCooldownUtils'; +export * from './src/Shared/Tracker/CooldownTracker'; diff --git a/src/cooldown/src/Client/Binders/CooldownClient.d.ts b/src/cooldown/src/Client/Binders/CooldownClient.d.ts new file mode 100644 index 00000000000..56b99361d81 --- /dev/null +++ b/src/cooldown/src/Client/Binders/CooldownClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { CooldownBase } from '../../Shared/Binders/CooldownBase'; +import { Binder } from '@quenty/binder'; + +interface CooldownClient extends CooldownBase {} + +interface CooldownClientConstructor { + readonly ClassName: 'CooldownClient'; + new (numberValue: NumberValue, serviceBag: ServiceBag): CooldownClient; +} + +export const CooldownClient: Binder; diff --git a/src/cooldown/src/Client/CooldownServiceClient.d.ts b/src/cooldown/src/Client/CooldownServiceClient.d.ts new file mode 100644 index 00000000000..3d1e08aa450 --- /dev/null +++ b/src/cooldown/src/Client/CooldownServiceClient.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface CooldownServiceClient { + readonly ServiceName: 'CooldownServiceClient'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/cooldown/src/Server/Binders/Cooldown.d.ts b/src/cooldown/src/Server/Binders/Cooldown.d.ts new file mode 100644 index 00000000000..3ae665857ac --- /dev/null +++ b/src/cooldown/src/Server/Binders/Cooldown.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { CooldownBase } from '../../Shared/Binders/CooldownBase'; +import { Binder } from '@quenty/binder'; + +interface Cooldown extends CooldownBase {} + +interface CooldownConstructor { + readonly ClassName: 'Cooldown'; + new (numberValue: NumberValue, serviceBag: ServiceBag): Cooldown; +} + +export const Cooldown: Binder; diff --git a/src/cooldown/src/Server/CooldownService.d.ts b/src/cooldown/src/Server/CooldownService.d.ts new file mode 100644 index 00000000000..77054c6bb8a --- /dev/null +++ b/src/cooldown/src/Server/CooldownService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface CooldownService { + readonly ServiceName: 'CooldownService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/cooldown/src/Shared/Binders/CooldownBase.d.ts b/src/cooldown/src/Shared/Binders/CooldownBase.d.ts new file mode 100644 index 00000000000..5edca77398f --- /dev/null +++ b/src/cooldown/src/Shared/Binders/CooldownBase.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; +import { CooldownModel } from '../Model/CooldownModel'; + +interface CooldownBase extends BaseObject { + Done: Signal; + GetCooldownModel(): CooldownModel; + GetObject(): NumberValue; + GetTimePassed(): number; + GetTimeRemaining(): number; + GetEndTime(): number; + GetStartTime(): number; + GetLength(): number; +} + +interface CooldownBaseConstructor { + readonly ClassName: 'CooldownBase'; + new (numberValue: NumberValue, serviceBag: ServiceBag): CooldownBase; +} + +export const CooldownBase: CooldownBaseConstructor; diff --git a/src/cooldown/src/Shared/Binders/CooldownShared.d.ts b/src/cooldown/src/Shared/Binders/CooldownShared.d.ts new file mode 100644 index 00000000000..a277b9a4aac --- /dev/null +++ b/src/cooldown/src/Shared/Binders/CooldownShared.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { CooldownBase } from './CooldownBase'; +import { Binder } from '@quenty/binder'; + +interface CooldownShared extends CooldownBase {} + +interface CooldownSharedConstructor { + readonly ClassName: 'CooldownShared'; + new (numberValue: NumberValue, serviceBag: ServiceBag): CooldownShared; +} + +export const CooldownShared: Binder; diff --git a/src/cooldown/src/Shared/CooldownConstants.d.ts b/src/cooldown/src/Shared/CooldownConstants.d.ts new file mode 100644 index 00000000000..b0ce4778fae --- /dev/null +++ b/src/cooldown/src/Shared/CooldownConstants.d.ts @@ -0,0 +1,4 @@ +export const CooldownConstants: Readonly<{ + COOLDOWN_TIME_NAME: 'CooldownTime'; + COOLDOWN_START_TIME_ATTRIBUTE: 'CooldownStartTime'; +}>; diff --git a/src/cooldown/src/Shared/CooldownUtils.d.ts b/src/cooldown/src/Shared/CooldownUtils.d.ts new file mode 100644 index 00000000000..d335ceea3ee --- /dev/null +++ b/src/cooldown/src/Shared/CooldownUtils.d.ts @@ -0,0 +1,11 @@ +import { Binder } from '@quenty/binder'; +import { CooldownBase } from './Binders/CooldownBase'; + +export namespace CooldownUtils { + function create(parent: Instance, length: number): NumberValue; + function findCooldown( + cooldownBinder: Binder, + parent: Instance + ): T | undefined; + function clone(cooldown: NumberValue): NumberValue; +} diff --git a/src/cooldown/src/Shared/Model/CooldownModel.d.ts b/src/cooldown/src/Shared/Model/CooldownModel.d.ts new file mode 100644 index 00000000000..cd113fc0083 --- /dev/null +++ b/src/cooldown/src/Shared/Model/CooldownModel.d.ts @@ -0,0 +1,25 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; +import { ClockFunction } from '@quenty/timesyncservice'; +import { Mountable } from '@quenty/valueobject'; + +interface CooldownModel extends BaseObject { + Done: Signal; + SetClock(clock: Mountable): void; + SetStartTime(startTime: Mountable): void; + SetLength(length: Mountable): void; + GetStartTime(): number; + GetTimeRemaining(): number; + GetTimePassed(): number; + GetEndTime(): number; + GetLength(): number; +} + +interface CooldownModelConstructor { + readonly ClassName: 'CooldownModel'; + new (): CooldownModel; + + isCooldownModel: (value: unknown) => value is CooldownModel; +} + +export const CooldownModel: CooldownModelConstructor; diff --git a/src/cooldown/src/Shared/Model/CooldownTrackerModel.d.ts b/src/cooldown/src/Shared/Model/CooldownTrackerModel.d.ts new file mode 100644 index 00000000000..b16152cbe67 --- /dev/null +++ b/src/cooldown/src/Shared/Model/CooldownTrackerModel.d.ts @@ -0,0 +1,23 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { CooldownModel } from './CooldownModel'; +import { Brio } from '@quenty/brio'; +import { Mountable } from '@quenty/valueobject'; + +interface CooldownTrackerModel extends BaseObject { + IsCoolingDown(): boolean; + ObserveActiveCooldownModel(): Observable; + ObserveActiveCooldownModelBrio(): Observable>; + SetCooldownModel( + cooldownModel: Mountable + ): () => void; +} + +interface CooldownTrackerModelConstructor { + readonly ClassName: 'CooldownTrackerModel'; + new (): CooldownTrackerModel; + + isCooldownTrackerModel: (value: unknown) => value is CooldownTrackerModel; +} + +export const CooldownTrackerModel: CooldownTrackerModelConstructor; diff --git a/src/cooldown/src/Shared/RxCooldownUtils.d.ts b/src/cooldown/src/Shared/RxCooldownUtils.d.ts new file mode 100644 index 00000000000..336bc918831 --- /dev/null +++ b/src/cooldown/src/Shared/RxCooldownUtils.d.ts @@ -0,0 +1,11 @@ +import { Binder } from '@quenty/binder'; +import { CooldownBase } from './Binders/CooldownBase'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export namespace RxCooldownUtils { + function observeCooldownBrio( + binder: Binder, + parent: Instance + ): Observable>; +} diff --git a/src/cooldown/src/Shared/Tracker/CooldownTracker.d.ts b/src/cooldown/src/Shared/Tracker/CooldownTracker.d.ts new file mode 100644 index 00000000000..102d52e9545 --- /dev/null +++ b/src/cooldown/src/Shared/Tracker/CooldownTracker.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { ValueObject } from '@quenty/valueobject'; +import { CooldownShared } from '../Binders/CooldownShared'; +import { CooldownTrackerModel } from '../Model/CooldownTrackerModel'; + +interface CooldownTracker extends BaseObject { + CurrentCooldown: ValueObject; + GetCooldownTrackerModel(): CooldownTrackerModel; + IsCoolingDown(): boolean; +} + +interface CooldownTrackerConstructor { + readonly ClassName: 'CooldownTracker'; + new (serviceBag: ServiceBag, parent: Instance): CooldownTracker; +} + +export const CooldownTracker: CooldownTrackerConstructor; diff --git a/src/coreguienabler/index.d.ts b/src/coreguienabler/index.d.ts new file mode 100644 index 00000000000..e0be55ccca2 --- /dev/null +++ b/src/coreguienabler/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/CoreGuiEnabler'; diff --git a/src/coreguienabler/src/Client/CoreGuiEnabler.d.ts b/src/coreguienabler/src/Client/CoreGuiEnabler.d.ts new file mode 100644 index 00000000000..a467c32fc62 --- /dev/null +++ b/src/coreguienabler/src/Client/CoreGuiEnabler.d.ts @@ -0,0 +1,20 @@ +import { Observable } from '@quenty/rx'; + +interface CoreGuiEnabler { + IsEnabled(state: string | Enum.CoreGuiType): boolean; + ObserveIsEnabled(state: string | Enum.CoreGuiType): Observable; + AddState( + state: string | Enum.CoreGuiType, + onChangeCallback: (isEnabled: boolean) => void + ): void; + Disable(state: string | Enum.CoreGuiType): void; + PushDisable(state: string | Enum.CoreGuiType): void; + Enable(key: unknown, state: string | Enum.CoreGuiType): void; +} + +interface CoreGuiEnablerConstructor { + readonly ClassName: 'CoreGuiEnabler'; + new (): CoreGuiEnabler; +} + +export const CoreGuiEnabler: CoreGuiEnablerConstructor; diff --git a/src/coreguiutils/index.d.ts b/src/coreguiutils/index.d.ts new file mode 100644 index 00000000000..3276d710ec6 --- /dev/null +++ b/src/coreguiutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/CoreGuiUtils'; diff --git a/src/coreguiutils/src/Client/CoreGuiUtils.d.ts b/src/coreguiutils/src/Client/CoreGuiUtils.d.ts new file mode 100644 index 00000000000..d1a0b0be098 --- /dev/null +++ b/src/coreguiutils/src/Client/CoreGuiUtils.d.ts @@ -0,0 +1,11 @@ +export namespace CoreGuiUtils { + function promiseRetrySetCore( + tries: number, + initialWaitTime: number, + ...args: Parameters + ): void; + function tryToSetCore( + parameter: T, + option: SettableCores[T] + ): boolean; +} diff --git a/src/countdowntext/index.d.ts b/src/countdowntext/index.d.ts new file mode 100644 index 00000000000..26f7bbea78e --- /dev/null +++ b/src/countdowntext/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/CountdownTextUtils'; diff --git a/src/countdowntext/src/Shared/CountdownTextUtils.d.ts b/src/countdowntext/src/Shared/CountdownTextUtils.d.ts new file mode 100644 index 00000000000..bdb01c0f6f7 --- /dev/null +++ b/src/countdowntext/src/Shared/CountdownTextUtils.d.ts @@ -0,0 +1,3 @@ +export namespace CountdownTextUtils { + function formatCountdown(seconds: number, whenAtZeroText?: string): string; +} diff --git a/src/counter/index.d.ts b/src/counter/index.d.ts new file mode 100644 index 00000000000..545b921fd40 --- /dev/null +++ b/src/counter/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Counter'; diff --git a/src/counter/src/Shared/Counter.d.ts b/src/counter/src/Shared/Counter.d.ts new file mode 100644 index 00000000000..fad966693d3 --- /dev/null +++ b/src/counter/src/Shared/Counter.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '../../../baseobject'; +import { Observable } from '../../../rx'; +import { Signal } from '@quenty/signal'; + +interface Counter extends BaseObject { + Changed: Signal; + GetValue(): number; + Add(amount: number | Observable): () => void; +} + +interface CounterConstructor { + readonly ClassName: 'Counter'; + new (): Counter; +} + +export const Counter: CounterConstructor; diff --git a/src/cubicspline/index.d.ts b/src/cubicspline/index.d.ts new file mode 100644 index 00000000000..74290989597 --- /dev/null +++ b/src/cubicspline/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/CubicSplineUtils'; +export * from './src/Shared/CubicTweenUtils'; diff --git a/src/cubicspline/src/Shared/CubicSplineUtils.d.ts b/src/cubicspline/src/Shared/CubicSplineUtils.d.ts new file mode 100644 index 00000000000..f3d41548aac --- /dev/null +++ b/src/cubicspline/src/Shared/CubicSplineUtils.d.ts @@ -0,0 +1,30 @@ +interface CubicSplineNode { + t: number; + p: T; + v: T; + optimize?: boolean; +} + +export namespace CubicSplineUtils { + function newSplineNode( + t: number, + position: T, + velocity: T + ): CubicSplineNode; + function tween( + nodeList: CubicSplineNode[], + t: number + ): CubicSplineNode | undefined; + function cloneSplineNode(node: CubicSplineNode): CubicSplineNode; + function tweenSplineNodes( + node0: CubicSplineNode, + node1: CubicSplineNode, + t: number + ): CubicSplineNode; + function sort(nodeList: CubicSplineNode[]): void; + function populateVelocities( + nodeList: CubicSplineNode[], + index0?: number, + index1?: number + ): void; +} diff --git a/src/cubicspline/src/Shared/CubicTweenUtils.d.ts b/src/cubicspline/src/Shared/CubicTweenUtils.d.ts new file mode 100644 index 00000000000..6511628d65a --- /dev/null +++ b/src/cubicspline/src/Shared/CubicTweenUtils.d.ts @@ -0,0 +1,37 @@ +type MathLike = number | Vector3 | Vector2; + +export namespace CubicTweenUtils { + function getConstants( + l: number, + t: number + ): LuaTuple<[a0: number, a1: number, a2: number, a3: number]>; + function getDerivativeConstants( + l: number, + t: number + ): LuaTuple<[b0: number, b1: number, b2: number, b3: number]>; + function applyConstants( + c0: number, + c1: number, + c2: number, + c3: number, + a: T, + u: T, + b: T, + v: T + ): MathLike; + function tween( + a: T, + u: T, + b: T, + v: T, + l: number, + t: number + ): T; + function getAcceleration( + a: T, + u: T, + b: T, + v: T, + l: number + ): T; +} diff --git a/src/datastore/index.d.ts b/src/datastore/index.d.ts new file mode 100644 index 00000000000..352365ea707 --- /dev/null +++ b/src/datastore/index.d.ts @@ -0,0 +1,10 @@ +export * from './src/Server/DataStore'; +export * from './src/Server/GameDataStoreService'; +export * from './src/Server/Modules/DataStoreDeleteToken'; +export * from './src/Server/Modules/DataStoreSnapshotUtils'; +export * from './src/Server/Modules/DataStoreStage'; +export * from './src/Server/Modules/DataStoreWriter'; +export * from './src/Server/PlayerDataStoreManager'; +export * from './src/Server/PlayerDataStoreService'; +export * from './src/Server/PrivateServerDataStoreService'; +export * from './src/Server/Utility/DataStorePromises'; diff --git a/src/datastore/src/Server/DataStore.d.ts b/src/datastore/src/Server/DataStore.d.ts new file mode 100644 index 00000000000..6756aa2f09a --- /dev/null +++ b/src/datastore/src/Server/DataStore.d.ts @@ -0,0 +1,28 @@ +import { Signal } from '@quenty/signal'; +import { DataStoreStage } from './Modules/DataStoreStage'; +import { RobloxDataStore } from './Utility/DataStorePromises'; +import { Promise } from '@quenty/promise'; + +interface DataStore extends DataStoreStage { + Saving: Signal; + SetDoDebugWriting(debugWriting: boolean): void; + GetFullPath(): string; + SetAutoSaveTimeSeconds(autoSaveTimeSeconds: number | undefined): void; + SetSyncOnSave(syncEnabled: boolean): void; + DidLoadFail(): boolean; + PromiseLoadSuccessful(): Promise; + Save(): Promise; + Sync(): Promise; + SetUserIdList(userIdList: number[] | undefined): void; + GetUserIdList(): number[] | undefined; +} + +interface DataStoreConstructor { + readonly ClassName: 'DataStore'; + new ( + robloxDataStore: RobloxDataStore, + key: string + ): DataStore; +} + +export const DataStore: DataStoreConstructor; diff --git a/src/datastore/src/Server/GameDataStoreService.d.ts b/src/datastore/src/Server/GameDataStoreService.d.ts new file mode 100644 index 00000000000..14b53049665 --- /dev/null +++ b/src/datastore/src/Server/GameDataStoreService.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { DataStore } from './DataStore'; + +export interface GameDataStoreService { + readonly ServiceName: 'GameDataStoreService'; + Init(serviceBag: ServiceBag): void; + PromiseDataStore(): Promise>; + Destroy(): void; +} diff --git a/src/datastore/src/Server/Modules/DataStoreDeleteToken.d.ts b/src/datastore/src/Server/Modules/DataStoreDeleteToken.d.ts new file mode 100644 index 00000000000..f422ecaf439 --- /dev/null +++ b/src/datastore/src/Server/Modules/DataStoreDeleteToken.d.ts @@ -0,0 +1,3 @@ +import { Symbol } from '@quenty/symbol'; + +export const DataStoreDeleteToken: Symbol; diff --git a/src/datastore/src/Server/Modules/DataStoreSnapshotUtils.d.ts b/src/datastore/src/Server/Modules/DataStoreSnapshotUtils.d.ts new file mode 100644 index 00000000000..83ee9e2a21f --- /dev/null +++ b/src/datastore/src/Server/Modules/DataStoreSnapshotUtils.d.ts @@ -0,0 +1,3 @@ +export namespace DataStoreSnapshotUtils { + function isEmptySnapshot(snapshot: unknown): boolean; +} diff --git a/src/datastore/src/Server/Modules/DataStoreStage.d.ts b/src/datastore/src/Server/Modules/DataStoreStage.d.ts new file mode 100644 index 00000000000..c88c29eb63b --- /dev/null +++ b/src/datastore/src/Server/Modules/DataStoreStage.d.ts @@ -0,0 +1,48 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { DataStoreWriter } from './DataStoreWriter'; +import { Maid } from '@quenty/maid'; + +export type DataStoreStageKey = string | number; + +export type DataStoreCallback = () => Promise | undefined; + +interface DataStoreStage extends BaseObject { + Changed: Signal; + DataStored: Signal; + Store(key: string, value: T): void; + Load(key: DataStoreStageKey): Promise; + Load(key: DataStoreStageKey, defaultValue: T): Promise; + LoadAll(): Promise>; + GetSubStore(key: DataStoreStageKey): DataStoreStage; + Delete(key: DataStoreStageKey): void; + Wipe(): void; + Observe(key?: DataStoreStageKey, defaultValue?: T): Observable; + AddSavingCallback(callback: DataStoreCallback): () => void; + RemoveSavingCallback(callback: DataStoreCallback): void; + GetTopLevelDataStoredSignal(): Signal; + GetFullPath(): string; + PromiseKeyList(): Promise; + PromiseKeySet(): Promise>; + MergeDiffSnapshot(diffSnapshot: T): void; + MarkDataAsSaved(parentWriter: DataStoreWriter): void; + PromiseViewUpToDate(): Promise; + Overwrite(data: T): void; + OverwriteMerge(data: T): void; + StoreOnValueChange(key: DataStoreStageKey, valueObj: ValueBase): Maid; + HasWritableData(): boolean; + GetNewWriter(): DataStoreWriter; + PromiseInvokeSavingCallbacks(): Promise; +} + +interface DataStoreStageConstructor { + readonly ClassName: 'DataStoreStage'; + new ( + loadName: DataStoreStageKey, + loadParent?: DataStoreStage + ): DataStoreStage; +} + +export const DataStoreStage: DataStoreStageConstructor; diff --git a/src/datastore/src/Server/Modules/DataStoreWriter.d.ts b/src/datastore/src/Server/Modules/DataStoreWriter.d.ts new file mode 100644 index 00000000000..9f2f4146bf1 --- /dev/null +++ b/src/datastore/src/Server/Modules/DataStoreWriter.d.ts @@ -0,0 +1,8 @@ +interface DataStoreWriter {} + +interface DataStoreWriterConstructor { + readonly ClassName: 'DataStoreWriter'; + new (): DataStoreWriter; +} + +export const DataStoreWriter: DataStoreWriterConstructor; diff --git a/src/datastore/src/Server/PlayerDataStoreManager.d.ts b/src/datastore/src/Server/PlayerDataStoreManager.d.ts new file mode 100644 index 00000000000..824747bd4d7 --- /dev/null +++ b/src/datastore/src/Server/PlayerDataStoreManager.d.ts @@ -0,0 +1,23 @@ +import { BaseObject } from '@quenty/baseobject'; +import { RobloxDataStore } from './Utility/DataStorePromises'; +import { Promise } from '@quenty/promise'; +import { DataStore } from './DataStore'; + +interface PlayerDataStoreManager extends BaseObject { + DisableSaveOnCloseStudio(): void; + AddRemovingCallback(callback: () => Promise | void): void; + RemovePlayerDataStore(player: Player): void; + GetDataStore(player: Player): DataStore | undefined; + PromiseAllSaves(): Promise; +} + +interface PlayerDataStoreManagerConstructor { + readonly ClassName: 'PlayerDataStoreManager'; + new ( + robloxDataStore: RobloxDataStore, + keyGenerator: (player: Player) => string, + skipBindingToClose?: boolean + ): PlayerDataStoreManager; +} + +export const PlayerDataStoreManager: PlayerDataStoreManagerConstructor; diff --git a/src/datastore/src/Server/PlayerDataStoreService.d.ts b/src/datastore/src/Server/PlayerDataStoreService.d.ts new file mode 100644 index 00000000000..9b466a5c841 --- /dev/null +++ b/src/datastore/src/Server/PlayerDataStoreService.d.ts @@ -0,0 +1,16 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { DataStore } from './DataStore'; +import { PlayerDataStoreManager } from './PlayerDataStoreManager'; + +export interface PlayerDataStoreService { + readonly ServiceName: 'PlayerDataStoreService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + SetDataStoreName(dataStoreName: string): void; + SetDataStoreScope(dataStoreScope: string): void; + PromiseDataStore(): Promise>; + PromiseAddRemovingCallback(callback: () => Promise | void): Promise; + PromiseManager(): Promise; + Destroy(): void; +} diff --git a/src/datastore/src/Server/PrivateServerDataStoreService.d.ts b/src/datastore/src/Server/PrivateServerDataStoreService.d.ts new file mode 100644 index 00000000000..b6d6044fcdf --- /dev/null +++ b/src/datastore/src/Server/PrivateServerDataStoreService.d.ts @@ -0,0 +1,11 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { DataStore } from './DataStore'; + +export interface PrivateServerDataStoreService { + readonly ServiceName: 'PrivateServerDataStoreService'; + Init(serviceBag: ServiceBag): void; + PromiseDataStore(): Promise>; + SetCustomKey(customKey: string): void; + Destroy(): void; +} diff --git a/src/datastore/src/Server/Utility/DataStorePromises.d.ts b/src/datastore/src/Server/Utility/DataStorePromises.d.ts new file mode 100644 index 00000000000..1b113d68757 --- /dev/null +++ b/src/datastore/src/Server/Utility/DataStorePromises.d.ts @@ -0,0 +1,50 @@ +import { Promise } from '@quenty/promise'; + +export type RobloxDataStore = DataStore; + +export namespace DataStorePromises { + function promiseDataStore(name: string, scope: string): Promise; + function promiseOrderedDataStore( + name: string, + scope: string + ): Promise; + function getAsync( + robloxDataStore: DataStore, + key: string + ): Promise<[value: unknown, dataStoreKeyInfo: DataStoreKeyInfo]>; + function updateAsync( + robloxDataStore: DataStore, + key: string, + updateFunc: ( + oldValue: O | undefined, + keyInfo: DataStoreKeyInfo | undefined + ) => LuaTuple<[newValue: R | undefined, userIds?: number[], metadata?: {}]> + ): Promise<[newValue: R | undefined, keyInfo: DataStoreKeyInfo]>; + function setAsync( + robloxDataStore: DataStore, + key: string, + value: unknown, + userIds?: number[] + ): Promise; + function promiseIncrementAsync( + robloxDataStore: DataStore, + key: string, + delta: number + ): Promise; + function removeAsync(robloxDataStore: DataStore, key: string): Promise; + function promiseSortedPagesAsync( + orderedDataStore: OrderedDataStore, + ascending: boolean, + pageSize: number, + minValue?: number, + maxValue?: number + ): Promise; + function promiseOrderedEntries( + orderedDataStore: OrderedDataStore, + ascending: boolean, + pageSize: number, + entries: number, + minValue?: number, + maxValue?: number + ): Promise ? T[] : never>; +} diff --git a/src/datastore/src/Shared/Utility/DataStoreStringUtils.d.ts b/src/datastore/src/Shared/Utility/DataStoreStringUtils.d.ts new file mode 100644 index 00000000000..b7afb6c2a7e --- /dev/null +++ b/src/datastore/src/Shared/Utility/DataStoreStringUtils.d.ts @@ -0,0 +1,8 @@ +export namespace DataStoreStringUtils { + function isValidUTF8( + str: string + ): LuaTuple< + | [success: true, errorMessage: undefined] + | [success: false, errorMessage: string] + >; +} diff --git a/src/deathreport/index.d.ts b/src/deathreport/index.d.ts new file mode 100644 index 00000000000..464fc1ecd5b --- /dev/null +++ b/src/deathreport/index.d.ts @@ -0,0 +1,17 @@ +export * from './src/Client/DeathReportBindersClient'; +export * from './src/Client/DeathReportServiceClient'; +export * from './src/Client/Stats/PlayerDeathTrackerClient'; +export * from './src/Client/Stats/PlayerKillTrackerClient'; +export * from './src/Client/Stats/TeamKillTrackerClient'; +export * from './src/Server/DeathReportBindersServer'; +export * from './src/Server/DeathReportService'; +export * from './src/Server/DeathTrackedHumanoid'; +export * from './src/Server/Stats/PlayerDeathTracker'; +export * from './src/Server/Stats/PlayerKillTracker'; +export * from './src/Server/Stats/PlayerKillTrackerAssigner'; +export * from './src/Server/Stats/TeamKillTracker'; +export * from './src/Shared/DeathReportProcessor'; +export * from './src/Shared/DeathReportServiceConstants'; +export * from './src/Shared/DeathReportUtils'; +export * from './src/Shared/Stats/PlayerKillTrackerUtils'; +export * from './src/Shared/Stats/TeamKillTrackerUtils'; diff --git a/src/deathreport/src/Client/DeathReportBindersClient.d.ts b/src/deathreport/src/Client/DeathReportBindersClient.d.ts new file mode 100644 index 00000000000..dcdd1fd3b1a --- /dev/null +++ b/src/deathreport/src/Client/DeathReportBindersClient.d.ts @@ -0,0 +1,10 @@ +import { BinderProvider } from '@quenty/binder'; +import { PlayerDeathTrackerClient } from './Stats/PlayerDeathTrackerClient'; +import { PlayerKillTrackerClient } from './Stats/PlayerKillTrackerClient'; +import { TeamKillTrackerClient } from './Stats/TeamKillTrackerClient'; + +export const DeathReportBindersClient: BinderProvider<{ + TeamKillTracker: TeamKillTrackerClient; + PlayerKillTracker: PlayerKillTrackerClient; + PlayerDeathTracker: PlayerDeathTrackerClient; +}>; diff --git a/src/deathreport/src/Client/DeathReportServiceClient.d.ts b/src/deathreport/src/Client/DeathReportServiceClient.d.ts new file mode 100644 index 00000000000..6464f25a711 --- /dev/null +++ b/src/deathreport/src/Client/DeathReportServiceClient.d.ts @@ -0,0 +1,16 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { DeathReport } from '../Shared/DeathReportUtils'; + +export interface DeathReportServiceClient { + readonly ServiceName: 'DeathReportServiceClient'; + Init(serviceBag: ServiceBag): void; + ObservePlayerKillerReports(player: Player): Observable; + ObservePlayerDeathReports(player: Player): Observable; + ObserveHumanoidKillerReports(humanoid: Humanoid): Observable; + ObserveHumanoidDeathReports(humanoid: Humanoid): Observable; + ObserveCharacterKillerReports(character: Model): Observable; + ObserveCharacterDeathReports(character: Model): Observable; + GetLastDeathReports(): DeathReport[]; + Destroy(): void; +} diff --git a/src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.d.ts b/src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.d.ts new file mode 100644 index 00000000000..a40d45415b8 --- /dev/null +++ b/src/deathreport/src/Client/Stats/PlayerDeathTrackerClient.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +interface PlayerDeathTrackerClient extends BaseObject { + DeathsChanged: Signal; + GetDeathValue(): IntValue; + GetPlayer(): Player | undefined; + GetKills(): number; +} + +interface PlayerDeathTrackerClientConstructor { + readonly ClassName: 'PlayerDeathTrackerClient'; + new (tracker: IntValue, serviceBag: ServiceBag): PlayerDeathTrackerClient; +} + +export const PlayerDeathTrackerClient: PlayerDeathTrackerClientConstructor; diff --git a/src/deathreport/src/Client/Stats/PlayerKillTrackerClient.d.ts b/src/deathreport/src/Client/Stats/PlayerKillTrackerClient.d.ts new file mode 100644 index 00000000000..1f5c824bfe6 --- /dev/null +++ b/src/deathreport/src/Client/Stats/PlayerKillTrackerClient.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +interface PlayerKillTrackerClient extends BaseObject { + DeathsChanged: Signal; + GetDeathValue(): IntValue; + GetPlayer(): Player | undefined; + GetKills(): number; +} + +interface PlayerKillTrackerClientConstructor { + readonly ClassName: 'PlayerKillTrackerClient'; + new (tracker: IntValue, serviceBag: ServiceBag): PlayerKillTrackerClient; +} + +export const PlayerKillTrackerClient: PlayerKillTrackerClientConstructor; diff --git a/src/deathreport/src/Client/Stats/TeamKillTrackerClient.d.ts b/src/deathreport/src/Client/Stats/TeamKillTrackerClient.d.ts new file mode 100644 index 00000000000..56b17fa5dd3 --- /dev/null +++ b/src/deathreport/src/Client/Stats/TeamKillTrackerClient.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +interface TeamKillTrackerClient extends BaseObject { + DeathsChanged: Signal; + GetDeathValue(): IntValue; + GetTeam(): Team | undefined; + GetKills(): number; +} + +interface TeamKillTrackerClientConstructor { + readonly ClassName: 'TeamKillTrackerClient'; + new (tracker: IntValue, serviceBag: ServiceBag): TeamKillTrackerClient; +} + +export const TeamKillTrackerClient: TeamKillTrackerClientConstructor; diff --git a/src/deathreport/src/Server/DeathReportBindersServer.d.ts b/src/deathreport/src/Server/DeathReportBindersServer.d.ts new file mode 100644 index 00000000000..f2c9cea6d2d --- /dev/null +++ b/src/deathreport/src/Server/DeathReportBindersServer.d.ts @@ -0,0 +1,10 @@ +import { BinderProvider } from '@quenty/binder'; +import { PlayerDeathTracker } from './Stats/PlayerDeathTracker'; +import { PlayerKillTracker } from './Stats/PlayerKillTracker'; +import { TeamKillTracker } from './Stats/TeamKillTracker'; + +export const DeathReportBindersServer: BinderProvider<{ + TeamKillTracker: TeamKillTracker; + PlayerKillTracker: PlayerKillTracker; + PlayerDeathTracker: PlayerDeathTracker; +}>; diff --git a/src/deathreport/src/Server/DeathReportService.d.ts b/src/deathreport/src/Server/DeathReportService.d.ts new file mode 100644 index 00000000000..7477f637ed5 --- /dev/null +++ b/src/deathreport/src/Server/DeathReportService.d.ts @@ -0,0 +1,23 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; +import { DeathReport, WeaponData } from '../Shared/DeathReportUtils'; +import { Observable } from '@quenty/rx'; + +export interface DeathReportService { + readonly ServiceName: 'DeathReportService'; + NewDeathReport: Signal; + Init(serviceBag: ServiceBag): void; + AddWeaponDataRetriever( + getWeaponData: (humanoid: Humanoid) => WeaponData | undefined + ): () => void; + FindWeaponData(humanoid: Humanoid): WeaponData | undefined; + ObservePlayerKillerReports(player: Player): Observable; + ObservePlayerDeathReports(player: Player): Observable; + ObserveHumanoidKillerReports(humanoid: Humanoid): Observable; + ObserveHumanoidDeathReports(humanoid: Humanoid): Observable; + ObserveCharacterKillerReports(character: Model): Observable; + ObserveCharacterDeathReports(character: Model): Observable; + ReportHumanoidDeath(humanoid: Humanoid, weaponData?: WeaponData): void; + ReportDeathReport(deathReport: DeathReport): void; + Destroy(): void; +} diff --git a/src/deathreport/src/Server/DeathTrackedHumanoid.d.ts b/src/deathreport/src/Server/DeathTrackedHumanoid.d.ts new file mode 100644 index 00000000000..f266d0358d7 --- /dev/null +++ b/src/deathreport/src/Server/DeathTrackedHumanoid.d.ts @@ -0,0 +1,12 @@ +import { BaseObject } from '@quenty/baseobject'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { ServiceBag } from '@quenty/servicebag'; + +interface DeathTrackedHumanoid extends BaseObject {} + +interface DeathTrackedHumanoidConstructor { + readonly ClassName: 'DeathTrackedHumanoid'; + new (humanoid: Humanoid, serviceBag: ServiceBag): DeathTrackedHumanoid; +} + +export const DeathTrackedHumanoid: PlayerHumanoidBinder; diff --git a/src/deathreport/src/Server/Stats/PlayerDeathTracker.d.ts b/src/deathreport/src/Server/Stats/PlayerDeathTracker.d.ts new file mode 100644 index 00000000000..c1fe437f35d --- /dev/null +++ b/src/deathreport/src/Server/Stats/PlayerDeathTracker.d.ts @@ -0,0 +1,11 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface PlayerDeathTracker extends BaseObject {} + +interface PlayerDeathTrackerConstructor { + readonly ClassName: 'PlayerDeathTracker'; + new (scoreObject: IntValue, serviceBag: ServiceBag): PlayerDeathTracker; +} + +export const PlayerDeathTracker: PlayerDeathTrackerConstructor; diff --git a/src/deathreport/src/Server/Stats/PlayerKillTracker.d.ts b/src/deathreport/src/Server/Stats/PlayerKillTracker.d.ts new file mode 100644 index 00000000000..8b815ed4ff8 --- /dev/null +++ b/src/deathreport/src/Server/Stats/PlayerKillTracker.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface PlayerKillTracker extends BaseObject { + GetKillValue(): IntValue; + GetPlayer(): Player | undefined; + GetKills(): number; +} + +interface PlayerKillTrackerConstructor { + readonly ClassName: 'PlayerKillTracker'; + new (scoreObject: IntValue, serviceBag: ServiceBag): PlayerKillTracker; +} + +export const PlayerKillTracker: PlayerKillTrackerConstructor; diff --git a/src/deathreport/src/Server/Stats/PlayerKillTrackerAssigner.d.ts b/src/deathreport/src/Server/Stats/PlayerKillTrackerAssigner.d.ts new file mode 100644 index 00000000000..c86321b59f2 --- /dev/null +++ b/src/deathreport/src/Server/Stats/PlayerKillTrackerAssigner.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerKillTracker } from './PlayerKillTracker'; + +interface PlayerKillTrackerAssigner extends BaseObject { + GetPlayerKills(player: Player): number | undefined; + GetPlayerKillTracker(player: Player): PlayerKillTracker | undefined; +} + +interface PlayerKillTrackerAssignerConstructor { + readonly ClassName: 'PlayerKillTrackerAssigner'; + new (serviceBag: ServiceBag): PlayerKillTrackerAssigner; +} + +export const PlayerKillTrackerAssigner: PlayerKillTrackerAssignerConstructor; diff --git a/src/deathreport/src/Server/Stats/TeamKillTracker.d.ts b/src/deathreport/src/Server/Stats/TeamKillTracker.d.ts new file mode 100644 index 00000000000..048c69bd1db --- /dev/null +++ b/src/deathreport/src/Server/Stats/TeamKillTracker.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface TeamKillTracker extends BaseObject { + GetTeam(): Team | undefined; + GetKills(): number; +} + +interface TeamKillTrackerConstructor { + readonly ClassName: 'TeamKillTracker'; + new (scoreObject: IntValue, serviceBag: ServiceBag): TeamKillTracker; +} + +export const TeamKillTracker: TeamKillTrackerConstructor; diff --git a/src/deathreport/src/Shared/DeathReportProcessor.d.ts b/src/deathreport/src/Shared/DeathReportProcessor.d.ts new file mode 100644 index 00000000000..2256ad27c12 --- /dev/null +++ b/src/deathreport/src/Shared/DeathReportProcessor.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { DeathReport } from './DeathReportUtils'; + +interface DeathReportProcessor extends BaseObject { + ObservePlayerKillerReports(player: Player): Observable; + ObservePlayerDeathReports(player: Player): Observable; + ObserveHumanoidDeathReports(humanoid: Humanoid): Observable; + ObserveHumanoidKillerReports(humanoid: Humanoid): Observable; + ObserveCharacterKillerReports(character: Model): Observable; + ObserveCharacterDeathReports(character: Model): Observable; + HandleDeathReport(deathReport: DeathReport): void; +} + +interface DeathReportProcessorConstructor { + readonly ClassName: 'DeathReportProcessor'; + new (): DeathReportProcessor; +} + +export const DeathReportProcessor: DeathReportProcessorConstructor; diff --git a/src/deathreport/src/Shared/DeathReportServiceConstants.d.ts b/src/deathreport/src/Shared/DeathReportServiceConstants.d.ts new file mode 100644 index 00000000000..2327d51c59d --- /dev/null +++ b/src/deathreport/src/Shared/DeathReportServiceConstants.d.ts @@ -0,0 +1,3 @@ +export const DeathReportServiceConstants: Readonly<{ + REMOTE_EVENT_NAME: 'DeathReportServiceRemoteEvent'; +}>; diff --git a/src/deathreport/src/Shared/DeathReportUtils.d.ts b/src/deathreport/src/Shared/DeathReportUtils.d.ts new file mode 100644 index 00000000000..293d33a9d02 --- /dev/null +++ b/src/deathreport/src/Shared/DeathReportUtils.d.ts @@ -0,0 +1,30 @@ +export interface WeaponData { + weaponInstance?: Instance; +} +export interface DeathReport { + type: 'deathReport'; + adornee: Instance; + humanoid?: Humanoid; + player?: Player; + killerAdornee?: Instance; + killerHumanoid?: Humanoid; + killerPlayer?: Player; + weaponData: WeaponData; +} + +export namespace DeathReportUtils { + function create( + adornee: Instance, + killerAdornee?: Instance, + weaponData?: WeaponData + ): DeathReport; + function isDeathReport(value: unknown): value is DeathReport; + function isWeaponData(value: unknown): value is WeaponData; + function createWeaponData(weaponInstance?: Instance): WeaponData; + function getDeadDisplayName(deathReport: DeathReport): string | undefined; + function involvesPlayer(deathReport: DeathReport, player: Player): boolean; + function getKillerDisplayName(deathReport: DeathReport): string | undefined; + function getDeadColor(deathReport: DeathReport): Color3 | undefined; + function getKillerColor(deathReport: DeathReport): Color3 | undefined; + function getDefaultColor(): Color3; +} diff --git a/src/deathreport/src/Shared/Stats/PlayerKillTrackerUtils.d.ts b/src/deathreport/src/Shared/Stats/PlayerKillTrackerUtils.d.ts new file mode 100644 index 00000000000..5e0845cbc3d --- /dev/null +++ b/src/deathreport/src/Shared/Stats/PlayerKillTrackerUtils.d.ts @@ -0,0 +1,15 @@ +import { Binder } from '@quenty/binder'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace PlayerKillTrackerUtils { + function create(binder: Binder, player: Player): void; + function observeBrio( + binder: Binder, + player: Player + ): Observable>; + function getPlayerKillTracker( + binder: Binder, + player: Player + ): T | undefined; +} diff --git a/src/deathreport/src/Shared/Stats/TeamKillTrackerUtils.d.ts b/src/deathreport/src/Shared/Stats/TeamKillTrackerUtils.d.ts new file mode 100644 index 00000000000..34296866a74 --- /dev/null +++ b/src/deathreport/src/Shared/Stats/TeamKillTrackerUtils.d.ts @@ -0,0 +1,12 @@ +import { Binder } from '@quenty/binder'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace TeamKillTrackerUtils { + function create(binder: Binder): void; + function observeBrio(binder: Binder, team: Team): Observable>; + function getPlayerKillTracker( + binder: Binder, + team: Team + ): T | undefined; +} diff --git a/src/debounce/index.d.ts b/src/debounce/index.d.ts new file mode 100644 index 00000000000..91cdf1c17fa --- /dev/null +++ b/src/debounce/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/DebounceTimer'; +export * from './src/Shared/debounce'; diff --git a/src/debounce/src/Shared/DebounceTimer.d.ts b/src/debounce/src/Shared/DebounceTimer.d.ts new file mode 100644 index 00000000000..17068124574 --- /dev/null +++ b/src/debounce/src/Shared/DebounceTimer.d.ts @@ -0,0 +1,14 @@ +interface DebounceTimer { + SetLength(length: number): void; + Restart(): void; + IsRunning(): boolean; + GetTimeRemaining(): number; + IsDone(): boolean; +} + +interface DebounceTimerConstructor { + readonly ClassName: 'DebounceTimer'; + new (length: number): DebounceTimer; +} + +export const DebounceTimer: DebounceTimerConstructor; diff --git a/src/debounce/src/Shared/debounce.d.ts b/src/debounce/src/Shared/debounce.d.ts new file mode 100644 index 00000000000..45f0e879bd9 --- /dev/null +++ b/src/debounce/src/Shared/debounce.d.ts @@ -0,0 +1,4 @@ +export const debounce: ( + timeoutInSeconds: number, + func: (...args: T) => unknown +) => (...args: T) => void; diff --git a/src/defaultvalueutils/index.d.ts b/src/defaultvalueutils/index.d.ts new file mode 100644 index 00000000000..105cd45be61 --- /dev/null +++ b/src/defaultvalueutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/DefaultValueUtils'; diff --git a/src/defaultvalueutils/src/Shared/DefaultValueUtils.d.ts b/src/defaultvalueutils/src/Shared/DefaultValueUtils.d.ts new file mode 100644 index 00000000000..46f42b4bdcb --- /dev/null +++ b/src/defaultvalueutils/src/Shared/DefaultValueUtils.d.ts @@ -0,0 +1,41 @@ +export type ValueTypeToDefaultValueType = { + boolean: false; + BrickColor: BrickColor; + CFrame: CFrame; + Color3: Color3; + ColorSequence: ColorSequence; + ColorSequenceKeypoint: ColorSequenceKeypoint; + number: 0; + PhysicalProperties: PhysicalProperties; + NumberRange: NumberRange; + NumberSequence: NumberSequence; + NumberSequenceKeypoint: NumberSequenceKeypoint; + Ray: Ray; + Rect: Rect; + Region3: Region3; + Region3int16: Region3int16; + string: ''; + UDim: UDim; + UDim2: UDim2; + userdata: {}; + Vector2: Vector2; + Vector2int16: Vector2int16; + Vector3: Vector3; + Vector3int16: Vector3int16; + table: {}; + nil: undefined; + Random: Random; + RaycastParams: RaycastParams; + OverlapParams: OverlapParams; +}; + +export namespace DefaultValueUtils { + function getDefaultValueForType(typeOfName: string): unknown; + function getDefaultValueForType( + typeOfName: T + ): ValueTypeToDefaultValueType[T]; + function toDefaultValue(value: unknown): unknown; + function toDefaultValue( + value: T + ): ValueTypeToDefaultValueType[T]; +} diff --git a/src/deferred/index.d.ts b/src/deferred/index.d.ts new file mode 100644 index 00000000000..41fa7189ab6 --- /dev/null +++ b/src/deferred/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/deferred'; diff --git a/src/deferred/src/Shared/deferred.d.ts b/src/deferred/src/Shared/deferred.d.ts new file mode 100644 index 00000000000..401d6b301f3 --- /dev/null +++ b/src/deferred/src/Shared/deferred.d.ts @@ -0,0 +1 @@ +export const deferred: typeof task.defer; diff --git a/src/depthoffield/index.d.ts b/src/depthoffield/index.d.ts new file mode 100644 index 00000000000..89abb040a20 --- /dev/null +++ b/src/depthoffield/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/DepthOfFieldEffect'; diff --git a/src/depthoffield/src/Client/DepthOfFieldEffect.d.ts b/src/depthoffield/src/Client/DepthOfFieldEffect.d.ts new file mode 100644 index 00000000000..c29d2ed0143 --- /dev/null +++ b/src/depthoffield/src/Client/DepthOfFieldEffect.d.ts @@ -0,0 +1,32 @@ +import { TransitionModel } from '@quenty/transitionmodel'; + +interface DepthOfFieldEffect extends TransitionModel { + SetShowSpeed(speed: number): void; + SetFocusDistanceTarget( + focusDistanceTarget: number, + doNotAnimate?: boolean + ): void; + SetFocusRadiusTarget( + inFocusRadiusTarget: number, + doNotAnimate?: boolean + ): void; + SetNearIntensityTarget( + nearIntensityTarget: number, + doNotAnimate?: boolean + ): void; + SetFarIntensityTarget( + farIntensityTarget: number, + doNotAnimate?: boolean + ): void; + GetFocusDistanceTarget(): number; + GetInFocusRadiusTarget(): number; + GetNearIntensityTarget(): number; + GetFarIntensityTarget(): number; +} + +interface DepthOfFieldEffectConstructor { + readonly ClassName: 'DepthOfFieldEffect'; + new (): DepthOfFieldEffect; +} + +export const DepthOfFieldEffect: DepthOfFieldEffectConstructor; diff --git a/src/draw/index.d.ts b/src/draw/index.d.ts new file mode 100644 index 00000000000..c8ea83f442b --- /dev/null +++ b/src/draw/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Draw'; diff --git a/src/draw/src/Shared/Draw.d.ts b/src/draw/src/Shared/Draw.d.ts new file mode 100644 index 00000000000..19cce848e17 --- /dev/null +++ b/src/draw/src/Shared/Draw.d.ts @@ -0,0 +1,141 @@ +export namespace Draw { + type Vector3Like = + | Vector3 + | CFrame + | Attachment + | BasePart + | Model + | RaycastResult + | PathWaypoint; + type Color3Like = Color3 | BrickColor | BasePart; + type CFrameLike = + | CFrame + | Vector3 + | Attachment + | BasePart + | Model + | RaycastResult + | PathWaypoint; + + function setColor(color: Color3): void; + function resetColor(): void; + function setRandomColor(): void; + function line( + start: Vector3, + finish: Vector3, + color?: Color3Like, + parent?: Instance, + diameter?: number + ): BasePart; + function direction( + origin: Vector3, + direction: Vector3, + color?: Color3, + parent?: Instance, + diameter?: number + ): BasePart; + function spherecast( + origin: Vector3Like, + radius: number, + direction: Vector3Like, + color?: Color3Like, + parent?: Instance + ): Folder; + function blockcast( + cframe: CFrameLike, + size: Vector3Like, + direction: Vector3Like, + color?: Color3Like, + parent?: Instance + ): Folder; + function triangle( + pointA: Vector3Like, + pointB: Vector3Like, + pointC: Vector3Like, + color?: Color3Like, + parent?: Instance + ): Folder; + function raycast( + origin: Vector3, + direction: Vector3, + color?: Color3, + parent?: Instance, + diameter?: number + ): BasePart; + function ray( + ray: Ray, + color?: Color3Like, + parent?: Instance, + diameter?: number + ): BasePart; + function updateRay( + rayPart: BasePart, + ray: Ray, + color?: Color3, + diameter?: number + ): void; + function text( + adornee: Instance | Vector3, + text: string, + color?: Color3Like + ): Instance; + function sphere( + position: Vector3Like, + radius: number, + color?: Color3, + parent?: Instance + ): BasePart; + function point( + position: Vector3Like, + color?: Color3Like, + parent?: Instance, + diameter?: number + ): BasePart; + function labelledPoint( + position: Vector3Like, + label: string, + color?: Color3Like, + parent?: Instance + ): BasePart; + function cframe(cframe: CFrameLike): Model; + function part( + template: BasePart, + cframe?: CFrameLike, + color?: Color3Like, + transparency?: number + ): BasePart; + function box( + cframe: CFrameLike, + size: Vector3Like, + color?: Color3Like + ): BasePart; + function region3(region3: Region3, color?: Color3Like): BasePart; + function terrainCell(position: Vector3Like, color?: Color3Like): BasePart; + function screenPointLine( + a: Vector2, + b: Vector2, + parent: Instance | undefined, + color: Color3Like + ): Frame; + function screenPoint( + position: Vector2, + parent: Instance, + color?: Color3Like, + diameter?: number + ): Frame; + function vector( + position: Vector3Like, + direction: Vector3Like, + color?: Color3, + parent?: Instance, + meshDiameter?: number + ): BasePart; + function ring( + position: Vector3Like, + normal: Vector3Like, + radius?: number, + color?: Color3Like, + parent?: Instance + ): Folder; + function getDefaultParent(): Instance | undefined; +} diff --git a/src/ducktype/index.d.ts b/src/ducktype/index.d.ts new file mode 100644 index 00000000000..ad74df2e878 --- /dev/null +++ b/src/ducktype/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/DuckTypeUtils'; diff --git a/src/ducktype/src/Shared/DuckTypeUtils.d.ts b/src/ducktype/src/Shared/DuckTypeUtils.d.ts new file mode 100644 index 00000000000..77739b63200 --- /dev/null +++ b/src/ducktype/src/Shared/DuckTypeUtils.d.ts @@ -0,0 +1,6 @@ +export namespace DuckTypeUtils { + function isImplementation( + template: unknown, + target: { new (...args: unknown[]): T } + ): template is T; +} diff --git a/src/ellipticcurvecryptography/index.d.ts b/src/ellipticcurvecryptography/index.d.ts new file mode 100644 index 00000000000..b53cb902312 --- /dev/null +++ b/src/ellipticcurvecryptography/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/EllipticCurveCryptography'; diff --git a/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/chacha20.d.ts b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/chacha20.d.ts new file mode 100644 index 00000000000..027285082bb --- /dev/null +++ b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/chacha20.d.ts @@ -0,0 +1,11 @@ +import { ByteTable } from '.'; + +export namespace chacha20 { + function crypt( + data: string | ByteTable, + key: ByteTable, + nonce: ByteTable, + cntr?: number, + round?: number + ): ByteTable; +} diff --git a/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/index.d.ts b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/index.d.ts new file mode 100644 index 00000000000..378ea31851e --- /dev/null +++ b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/index.d.ts @@ -0,0 +1,30 @@ +import { chacha20 as chacha20ns } from './chacha20'; +import { sha256 as sha256ns } from './sha256'; +import { random as randomns } from './random'; + +export type ByteTable = number[] & { + __brand: 'ByteTable'; +} & { + toHex(): string; + isEqual(other: ByteTable): boolean; +}; + +export namespace EllipticCurveCryptography { + const chacha20: typeof chacha20ns; + const sha256: typeof sha256ns; + const random: typeof randomns; + function isByteTable(value: unknown): value is ByteTable; + function createByteTable(value: number[]): ByteTable; + function encrypt(data: string | ByteTable, key: ByteTable): ByteTable; + function decrypt(data: string | ByteTable, key: ByteTable): ByteTable; + function keypair( + seed: number + ): LuaTuple<[privateKey: ByteTable, publicKey: ByteTable]>; + function exchange(privateKey: ByteTable, publicKey: ByteTable): ByteTable; + function sign(privateKey: ByteTable, message: string | ByteTable): ByteTable; + function verify( + publicKey: ByteTable, + message: string | ByteTable, + signature: ByteTable + ): boolean; +} diff --git a/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/random.d.ts b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/random.d.ts new file mode 100644 index 00000000000..205594b4ec9 --- /dev/null +++ b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/random.d.ts @@ -0,0 +1,7 @@ +import { ByteTable } from '.'; + +export namespace random { + function save(): void; + function seed(data: unknown): void; + function random(): ByteTable; +} diff --git a/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/sha256.d.ts b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/sha256.d.ts new file mode 100644 index 00000000000..78838f13a2e --- /dev/null +++ b/src/ellipticcurvecryptography/src/Shared/EllipticCurveCryptography/sha256.d.ts @@ -0,0 +1,12 @@ +import { ByteTable } from '.'; + +export namespace sha256 { + function digest(data: string | ByteTable): ByteTable; + function hmac(data: string | ByteTable, key: string | ByteTable): ByteTable; + function pbkdf2( + pass: string | ByteTable, + salt: string | ByteTable, + iter: number, + dklen?: number + ): ByteTable; +} diff --git a/src/elo/index.d.ts b/src/elo/index.d.ts new file mode 100644 index 00000000000..af5a77a5d3a --- /dev/null +++ b/src/elo/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/EloMatchResult'; +export * from './src/Shared/EloMatchResultUtils'; +export * from './src/Shared/EloUtils'; diff --git a/src/elo/src/Shared/EloMatchResult.d.ts b/src/elo/src/Shared/EloMatchResult.d.ts new file mode 100644 index 00000000000..2a9dd49cad5 --- /dev/null +++ b/src/elo/src/Shared/EloMatchResult.d.ts @@ -0,0 +1,7 @@ +export type EloMatchResult = 1 | 0.5 | 0; + +export const EloMatchResult: Readonly<{ + PLAYER_ONE_WIN: 1; + DRAW: 0.5; + PLAYER_TWO_WIN: 0; +}>; diff --git a/src/elo/src/Shared/EloMatchResultUtils.d.ts b/src/elo/src/Shared/EloMatchResultUtils.d.ts new file mode 100644 index 00000000000..da74d75283c --- /dev/null +++ b/src/elo/src/Shared/EloMatchResultUtils.d.ts @@ -0,0 +1,6 @@ +import { EloMatchResult } from './EloMatchResult'; + +export namespace EloMatchResultUtils { + function isEloMatchResult(value: unknown): value is EloMatchResult; + function isEloMatchResultList(value: unknown): value is EloMatchResult[]; +} diff --git a/src/elo/src/Shared/EloUtils.d.ts b/src/elo/src/Shared/EloUtils.d.ts new file mode 100644 index 00000000000..1325576f1e5 --- /dev/null +++ b/src/elo/src/Shared/EloUtils.d.ts @@ -0,0 +1,56 @@ +import { EloMatchResult } from './EloMatchResult'; + +export interface EloConfig { + factor: number; + kfactor: number | ((rating: number) => number); + initial: number; + ratingFloor: number; + groupMultipleResultAsOne: boolean; +} + +export namespace EloUtils { + function createConfig(config?: Partial): EloConfig; + function isEloConfig(value: unknown): value is EloConfig; + function getStandardDeviation(eloConfig: EloConfig): number; + function getPercentile(eloConfig: EloConfig, elo: number): number; + function percentileToElo( + eloConfig: EloConfig, + percentile: number + ): number | undefined; + function getNewElo( + eloConfig: EloConfig, + playerOneRating: number, + playerTwoRating: number, + eloMatchResultList: EloMatchResult[] + ): LuaTuple<[newPlayerOneRating: number, newPlayerTwoRating: number]>; + function getEloChange( + eloConfig: EloConfig, + playerOneRating: number, + playerTwoRating: number, + eloMatchResultList: EloMatchResult[] + ): LuaTuple<[playerOneEloChange: number, playerTwoEloChange: number]>; + function getNewPlayerOneScore( + eloConfig: EloConfig, + playerOneRating: number, + playerTwoRating: number, + eloMatchResultList: EloMatchResult[] + ): number; + function getPlayerOneExpected( + eloConfig: EloConfig, + playerOneRating: number, + playerTwoRating: number + ): number; + function getPlayerOneScoreAdjustment( + eloConfig: EloConfig, + playerOneRating: number, + playerTwoRating: number, + eloMatchResultList: EloMatchResult[] + ): number; + function fromOpponentPerspective( + eloMatchResultList: EloMatchResult[] + ): EloMatchResult[]; + function countPlayerOneWins(eloMatchResultList: EloMatchResult[]): number; + function countPlayerTwoWins(eloMatchResultList: EloMatchResult[]): number; + function standardKFactorFormula(rating: number): number; + function extractKFactor(eloConfig: EloConfig, rating: number): number; +} diff --git a/src/enabledmixin/index.d.ts b/src/enabledmixin/index.d.ts new file mode 100644 index 00000000000..3d3a303fe22 --- /dev/null +++ b/src/enabledmixin/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/EnabledMixin'; diff --git a/src/enabledmixin/src/Shared/EnabledMixin.d.ts b/src/enabledmixin/src/Shared/EnabledMixin.d.ts new file mode 100644 index 00000000000..918d5182d66 --- /dev/null +++ b/src/enabledmixin/src/Shared/EnabledMixin.d.ts @@ -0,0 +1,15 @@ +import { Maid } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; + +export interface EnabledMixin { + InitEnabledMixin(maid?: Maid): void; + IsEnabled(): boolean; + Enable(doNotAnimate?: boolean): void; + Disable(doNotAnimate?: boolean): void; + ObserveIsEnabled(): Observable; + SetEnabled(isEnabled: boolean, doNotAnimate?: boolean): void; +} + +export const EnabledMixin: { + Add(classObj: { new (...args: unknown[]): unknown }): void; +}; diff --git a/src/enums/index.d.ts b/src/enums/index.d.ts new file mode 100644 index 00000000000..25f1af20354 --- /dev/null +++ b/src/enums/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/SimpleEnum'; diff --git a/src/enums/src/Shared/SimpleEnum.d.ts b/src/enums/src/Shared/SimpleEnum.d.ts new file mode 100644 index 00000000000..19e935fc19a --- /dev/null +++ b/src/enums/src/Shared/SimpleEnum.d.ts @@ -0,0 +1,14 @@ +type SimpleEnum = T & { + GetKeys(): (keyof T)[]; + GetValues(): T[keyof T][]; + GetMap(): Readonly; + IsValue(value: string): value is T[keyof T]; + GetInterface(): (value: unknown) => value is T[keyof T]; +} & IterableFunction>; + +interface SimpleEnumConstructor { + readonly ClassName: 'SimpleEnum'; + new >(entries: T): SimpleEnum; +} + +export const SimpleEnum: SimpleEnumConstructor; diff --git a/src/enumutils/index.d.ts b/src/enumutils/index.d.ts new file mode 100644 index 00000000000..cd3ee259a0d --- /dev/null +++ b/src/enumutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/EnumUtils'; diff --git a/src/enumutils/src/Shared/EnumUtils.d.ts b/src/enumutils/src/Shared/EnumUtils.d.ts new file mode 100644 index 00000000000..6ea821a51cf --- /dev/null +++ b/src/enumutils/src/Shared/EnumUtils.d.ts @@ -0,0 +1,13 @@ +export namespace EnumUtils { + function encodeAsString(enumItem: EnumItem): string; + function isOfType( + expectedEnumType: Enum, + enumItem: EnumItem + ): LuaTuple<[success: boolean, err: string]>; + function toEnum( + enumType: Enum, + value: EnumItem | number | string + ): EnumItem | undefined; + function isEncodedEnum(value: string): boolean; + function decodeFromString(value: string): EnumItem | undefined; +} diff --git a/src/equippedtracker/index.d.ts b/src/equippedtracker/index.d.ts new file mode 100644 index 00000000000..80a36643b46 --- /dev/null +++ b/src/equippedtracker/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/EquippedTracker'; diff --git a/src/equippedtracker/src/Shared/EquippedTracker.d.ts b/src/equippedtracker/src/Shared/EquippedTracker.d.ts new file mode 100644 index 00000000000..18f87faccb2 --- /dev/null +++ b/src/equippedtracker/src/Shared/EquippedTracker.d.ts @@ -0,0 +1,13 @@ +import { ValueObject } from '../../../valueobject'; + +type EquippedTracker = { + Player: ValueObject; + Destroy(): void; +}; + +interface EquippedTrackerConstructor { + readonly ClassName: 'EquippedTracker'; + new (tool: Tool): EquippedTracker; +} + +export const EquippedTracker: EquippedTrackerConstructor; diff --git a/src/experiencecalculator/index.d.ts b/src/experiencecalculator/index.d.ts new file mode 100644 index 00000000000..e27a956fc82 --- /dev/null +++ b/src/experiencecalculator/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ExperienceUtils'; diff --git a/src/experiencecalculator/src/Shared/ExperienceUtils.d.ts b/src/experiencecalculator/src/Shared/ExperienceUtils.d.ts new file mode 100644 index 00000000000..d084320f824 --- /dev/null +++ b/src/experiencecalculator/src/Shared/ExperienceUtils.d.ts @@ -0,0 +1,29 @@ +export interface ExperienceConfig { + factor: number; + maxLevel: number; +} + +export namespace ExperienceUtils { + function createExperienceConfig( + options: Partial + ): ExperienceConfig; + function isExperienceConfig(value: unknown): value is ExperienceConfig; + function getLevel(config: ExperienceConfig, totalExperience: number): number; + function experienceFromLevel(config: ExperienceConfig, level: number): number; + function levelExperienceEarned( + config: ExperienceConfig, + totalExperience: number + ): number; + function levelExperienceLeft( + config: ExperienceConfig, + totalExperience: number + ): number; + function levelExperienceRequired( + config: ExperienceConfig, + totalExperience: number + ): number; + function percentLevelComplete( + config: ExperienceConfig, + totalExperience: number + ): number; +} diff --git a/src/fakeskybox/index.d.ts b/src/fakeskybox/index.d.ts new file mode 100644 index 00000000000..34bc32a91db --- /dev/null +++ b/src/fakeskybox/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/FakeSkybox'; +export * from './src/Client/FakeSkyboxSide'; diff --git a/src/fakeskybox/src/Client/FakeSkybox.d.ts b/src/fakeskybox/src/Client/FakeSkybox.d.ts new file mode 100644 index 00000000000..96d61a520b1 --- /dev/null +++ b/src/fakeskybox/src/Client/FakeSkybox.d.ts @@ -0,0 +1,28 @@ +import { Signal } from '@quenty/signal'; + +interface Skybox { + SkyboxUp: string; + SkyboxDn: string; + SkyboxLf: string; + SkyboxRt: string; + SkyboxFt: string; + SkyboxBk: string; +} + +interface FakeSkybox { + VisibleChanged: Signal<[isVisible: boolean, doNotAnimate?: boolean]>; + SetPartSize(size: number): this; + Show(doNotAnimate?: boolean): this; + Hide(doNotAnimate?: boolean): this; + SetSkybox(skybox: Skybox): this; + IsVisible(): boolean; + UpdateRender(baseCFrame: CFrame): void; + Destroy(): void; +} + +interface FakeSkyboxConstructor { + readonly ClassName: 'FakeSkybox'; + new (skybox: Skybox): FakeSkybox; +} + +export const FakeSkybox: FakeSkyboxConstructor; diff --git a/src/fakeskybox/src/Client/FakeSkyboxSide.d.ts b/src/fakeskybox/src/Client/FakeSkyboxSide.d.ts new file mode 100644 index 00000000000..5021e63458c --- /dev/null +++ b/src/fakeskybox/src/Client/FakeSkyboxSide.d.ts @@ -0,0 +1,17 @@ +interface FakeSkyboxSide { + SetPartSize(partSize: number): this; + UpdateSizing(): void; + SetImage(image: string): this; + SetTransparency(transparency: number): this; + UpdateRender(relativeCFrame: CFrame): void; +} + +interface FakeSkyboxSideConstructor { + readonly ClassName: 'FakeSkyboxSide'; + new (partSize: number, normal: Vector3, parent: Instance): FakeSkyboxSide; + + CanvasSize: 1024; + PartWidth: 1; +} + +export const FakeSkyboxSide: FakeSkyboxSideConstructor; diff --git a/src/firstpersoncharactertransparency/index.d.ts b/src/firstpersoncharactertransparency/index.d.ts new file mode 100644 index 00000000000..dd099cf345f --- /dev/null +++ b/src/firstpersoncharactertransparency/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/HideHead'; +export * from './src/Client/ShowBody'; diff --git a/src/firstpersoncharactertransparency/src/Client/HideHead.d.ts b/src/firstpersoncharactertransparency/src/Client/HideHead.d.ts new file mode 100644 index 00000000000..1807dfee6f7 --- /dev/null +++ b/src/firstpersoncharactertransparency/src/Client/HideHead.d.ts @@ -0,0 +1,11 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface HideHead extends BaseObject {} + +interface HideHeadConstructor { + readonly ClassName: 'HideHead'; + new (character: Model, serviceBag: ServiceBag): HideHead; +} + +export const HideHead: HideHeadConstructor; diff --git a/src/firstpersoncharactertransparency/src/Client/ShowBody.d.ts b/src/firstpersoncharactertransparency/src/Client/ShowBody.d.ts new file mode 100644 index 00000000000..758051906be --- /dev/null +++ b/src/firstpersoncharactertransparency/src/Client/ShowBody.d.ts @@ -0,0 +1,11 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface ShowBody extends BaseObject {} + +interface ShowBodyConstructor { + readonly ClassName: 'ShowBody'; + new (character: Model, serviceBag: ServiceBag): ShowBody; +} + +export const ShowBody: ShowBodyConstructor; diff --git a/src/flipbook/index.d.ts b/src/flipbook/index.d.ts new file mode 100644 index 00000000000..5f84ad901e4 --- /dev/null +++ b/src/flipbook/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Client/Flipbook'; +export * from './src/Client/Library/FlipbookLibrary'; +export * from './src/Client/Player/FlipbookPlayer'; diff --git a/src/flipbook/src/Client/Flipbook.d.ts b/src/flipbook/src/Client/Flipbook.d.ts new file mode 100644 index 00000000000..43e67cce2eb --- /dev/null +++ b/src/flipbook/src/Client/Flipbook.d.ts @@ -0,0 +1,35 @@ +import { Sprite } from '@quenty/sprites'; + +export interface FlipbookData { + image: string; + frameCount: number; + rows: number; + columns: number; + imageRectSize: Vector2; + frameRate?: number; + restFrame?: number; +} + +interface Flipbook { + GetRestFrame(): number | undefined; + SetSpriteAtIndex(index: number, sprite: Sprite): void; + SetImageRectSize(imageRectSize: Vector2): void; + SetFrameCount(frameCount: number): void; + SetFrameRate(frameRate: number): void; + GetPreloadAssetId(): string[]; + GetSprite(index: number): Sprite | undefined; + HasSprite(index: number): boolean; + GetImageRectSize(): Vector2; + GetFrameRate(): number; + GetPlayTime(): number; + GetFrameCount(): number; +} + +interface FlipbookConstructor { + readonly ClassName: 'Flipbook'; + new (data: FlipbookData): Flipbook; + + isFlipbook: (value: unknown) => value is Flipbook; +} + +export const Flipbook: FlipbookConstructor; diff --git a/src/flipbook/src/Client/Library/FlipbookLibrary.d.ts b/src/flipbook/src/Client/Library/FlipbookLibrary.d.ts new file mode 100644 index 00000000000..f1fa647c2b8 --- /dev/null +++ b/src/flipbook/src/Client/Library/FlipbookLibrary.d.ts @@ -0,0 +1,26 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Flipbook } from '../Flipbook'; + +interface FlipbookLibrary { + Init(serviceBag: ServiceBag): void; + GetPreloadAssetIds(): string[]; + GetFlipbook( + flipbookName: string, + theme?: 'Light' | 'Dark' + ): Flipbook | undefined; + Register( + flipbookName: string, + theme: 'Light' | 'Dark', + flipbook: Flipbook + ): void; +} + +interface FlipbookLibraryConstructor { + readonly ClassName: 'FlipbookLibrary'; + new ( + serviceName: string, + register: (this: FlipbookLibrary) => void + ): FlipbookLibrary; +} + +export const FlipbookLibrary: FlipbookLibraryConstructor; diff --git a/src/flipbook/src/Client/Player/FlipbookPlayer.d.ts b/src/flipbook/src/Client/Player/FlipbookPlayer.d.ts new file mode 100644 index 00000000000..3c876e2858c --- /dev/null +++ b/src/flipbook/src/Client/Player/FlipbookPlayer.d.ts @@ -0,0 +1,23 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Flipbook } from '../Flipbook'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +interface FlipbookPlayer extends BaseObject { + SetFlipbook(flipbook: Flipbook): void; + GetFlipbook(): Flipbook | undefined; + PromisePlayOnce(): Promise; + PromisePlayRepeat(times: number): Promise; + SetIsBoomarang(isBoomerang: boolean): void; + Play(): void; + Stop(): void; + IsPlaying(): boolean; + ObserveIsPlaying(): Observable; +} + +interface FlipbookPlayerConstructor { + readonly ClassName: 'FlipbookPlayer'; + new (imageLabel: ImageLabel | ImageButton): FlipbookPlayer; +} + +export const FlipbookPlayer: FlipbookPlayerConstructor; diff --git a/src/friendutils/index.d.ts b/src/friendutils/index.d.ts new file mode 100644 index 00000000000..fed7f7ca014 --- /dev/null +++ b/src/friendutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/FriendUtils'; +export * from './src/Shared/RxFriendUtils'; diff --git a/src/friendutils/src/Shared/FriendUtils.d.ts b/src/friendutils/src/Shared/FriendUtils.d.ts new file mode 100644 index 00000000000..9eafed8d11f --- /dev/null +++ b/src/friendutils/src/Shared/FriendUtils.d.ts @@ -0,0 +1,25 @@ +import { Promise } from '@quenty/promise'; + +interface FriendData { + AvatarFinal: boolean; + AvatarUri: string; + Id: number; + Username: string; + IsOnline: boolean; +} + +export namespace FriendUtils { + function promiseAllStudioFriends(): Promise; + function onlineFriends(friends: FriendData[]): FriendData[]; + function friendsNotInGame(friends: FriendData[]): FriendData[]; + function promiseAllFriends( + userId: number, + limitMaxFriends?: number + ): Promise; + function promiseFriendPages(userId: number): Promise; + function iterateFriendsYielding( + pages: FriendPages + ): IterableIterator; + function promiseStudioServiceUserId(): Promise; + function promiseCurrentStudioUserId(): Promise; +} diff --git a/src/friendutils/src/Shared/RxFriendUtils.d.ts b/src/friendutils/src/Shared/RxFriendUtils.d.ts new file mode 100644 index 00000000000..abf87afdeef --- /dev/null +++ b/src/friendutils/src/Shared/RxFriendUtils.d.ts @@ -0,0 +1,8 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxFriendUtils { + function observeFriendsInServerAsBrios( + player?: Player + ): Observable>; +} diff --git a/src/functionutils/index.d.ts b/src/functionutils/index.d.ts new file mode 100644 index 00000000000..de15a7ea362 --- /dev/null +++ b/src/functionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/FunctionUtils'; diff --git a/src/functionutils/src/Shared/FunctionUtils.d.ts b/src/functionutils/src/Shared/FunctionUtils.d.ts new file mode 100644 index 00000000000..91f311c6b10 --- /dev/null +++ b/src/functionutils/src/Shared/FunctionUtils.d.ts @@ -0,0 +1,6 @@ +export namespace FunctionUtils { + function bind( + self: S, + func: (self: S, ...args: A) => R + ): (...args: A) => R; +} diff --git a/src/funnels/index.d.ts b/src/funnels/index.d.ts new file mode 100644 index 00000000000..aa882873f26 --- /dev/null +++ b/src/funnels/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Steps/FunnelStepTracker'; +export * from './src/Server/Steps/FunnelStepLogger'; diff --git a/src/funnels/src/Server/Steps/FunnelStepLogger.d.ts b/src/funnels/src/Server/Steps/FunnelStepLogger.d.ts new file mode 100644 index 00000000000..340d96d4b41 --- /dev/null +++ b/src/funnels/src/Server/Steps/FunnelStepLogger.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface FunnelStepLogger extends BaseObject { + SetPrintDebugEnabled(debugEnabled: boolean): void; + LogStep(stepNumber: number, stepName: string): void; + IsStepComplete(stepNumber: number): boolean; +} + +interface FunnelStepLoggerConstructor { + readonly ClassName: 'FunnelStepLogger'; + new (): FunnelStepLogger; +} + +export const FunnelStepLogger: FunnelStepLoggerConstructor; diff --git a/src/funnels/src/Shared/Steps/FunnelStepTracker.d.ts b/src/funnels/src/Shared/Steps/FunnelStepTracker.d.ts new file mode 100644 index 00000000000..d1532531a45 --- /dev/null +++ b/src/funnels/src/Shared/Steps/FunnelStepTracker.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; + +interface FunnelStepTracker extends BaseObject { + StepLogged: Signal<[stepNumber: number, stepName: string]>; + + LogStep(stepNumber: number, stepName: string): void; + IsStepComplete(stepNumber: number): boolean; + GetLoggedSteps(): { [stepNumber: number]: string }; + ClearLoggedSteps(): void; +} + +interface FunnelStepTrackerConstructor { + readonly ClassName: 'FunnelStepTracker'; + new (): FunnelStepTracker; +} + +export const FunnelStepTracker: FunnelStepTrackerConstructor; diff --git a/src/fzy/index.d.ts b/src/fzy/index.d.ts new file mode 100644 index 00000000000..0d037874f06 --- /dev/null +++ b/src/fzy/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Fzy'; diff --git a/src/fzy/src/Shared/Fzy.d.ts b/src/fzy/src/Shared/Fzy.d.ts new file mode 100644 index 00000000000..a43d3fe5fba --- /dev/null +++ b/src/fzy/src/Shared/Fzy.d.ts @@ -0,0 +1,43 @@ +export interface FzyConfig { + caseSensitive: boolean; + gapLeadingScore: number; + gapTrailingScore: number; + gapInnerScore: number; + consecutiveMatchScore: number; + slashMatchScore: number; + wordMatchScore: number; + capitalMatchScore: number; + dotMatchScore: number; + maxMatchLength: number; +} + +export namespace Fzy { + function createConfig(config: Partial): FzyConfig; + function isFzyConfig(value: unknown): value is FzyConfig; + function hasMatch( + config: FzyConfig, + needle: string, + haystack: string + ): boolean; + function isPerfectMatch( + config: FzyConfig, + needle: string, + haystack: string + ): boolean; + function score(config: FzyConfig, needle: string, haystack: string): number; + function positions( + config: FzyConfig, + needle: string, + haystack: string + ): LuaTuple<[indices: number[], score: number]>; + function filter( + config: FzyConfig, + needle: string, + haystacks: string[] + ): [idx: number, positions: number[], score: number][]; + function getMinScore(): number; + function getMaxScore(): number; + function getMaxLength(config: FzyConfig): number; + function getScoreFloor(config: FzyConfig): number; + function getScoreCeiling(config: FzyConfig): number; +} diff --git a/src/gameconfig/index.d.ts b/src/gameconfig/index.d.ts new file mode 100644 index 00000000000..52c78249d8d --- /dev/null +++ b/src/gameconfig/index.d.ts @@ -0,0 +1,24 @@ +export * from './src/Client/Cmdr/GameConfigCommandServiceClient'; +export * from './src/Client/Config/Asset/GameConfigAssetClient'; +export * from './src/Client/Config/Config/GameConfigClient'; +export * from './src/Client/GameConfigBindersClient'; +export * from './src/Client/GameConfigServiceClient'; +export * from './src/Server/Cmdr/GameConfigCommandService'; +export * from './src/Server/Config/Asset/GameConfigAsset'; +export * from './src/Server/Config/Config/GameConfig'; +export * from './src/Server/GameConfigBindersServer'; +export * from './src/Server/GameConfigService'; +export * from './src/Server/GameConfigServiceConstants'; +export * from './src/Server/Mantle/MantleConfigProvider'; +export * from './src/Shared/Cmdr/GameConfigCmdrUtils'; +export * from './src/Shared/Config/Asset/GameConfigAssetBase'; +export * from './src/Shared/Config/Asset/GameConfigAssetConstants'; +export * from './src/Shared/Config/Asset/GameConfigAssetUtils'; +export * from './src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils'; +export * from './src/Shared/Config/AssetTypes/GameConfigAssetTypes'; +export * from './src/Shared/Config/Config/GameConfigBase'; +export * from './src/Shared/Config/Config/GameConfigConstants'; +export * from './src/Shared/Config/Config/GameConfigUtils'; +export * from './src/Shared/Config/Picker/GameConfigPicker'; +export * from './src/Shared/GameConfigDataService'; +export * from './src/Shared/GameConfigTranslator'; diff --git a/src/gameconfig/src/Client/Cmdr/GameConfigCommandServiceClient.d.ts b/src/gameconfig/src/Client/Cmdr/GameConfigCommandServiceClient.d.ts new file mode 100644 index 00000000000..6bd99cb1dbb --- /dev/null +++ b/src/gameconfig/src/Client/Cmdr/GameConfigCommandServiceClient.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface GameConfigCommandServiceClient { + readonly ServiceName: 'GameConfigCommandServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/gameconfig/src/Client/Config/Asset/GameConfigAssetClient.d.ts b/src/gameconfig/src/Client/Config/Asset/GameConfigAssetClient.d.ts new file mode 100644 index 00000000000..0296d7783c6 --- /dev/null +++ b/src/gameconfig/src/Client/Config/Asset/GameConfigAssetClient.d.ts @@ -0,0 +1,11 @@ +import { GameConfigAssetBase } from '@quenty/gameconfig/src/Shared/Config/Asset/GameConfigAssetBase'; +import { ServiceBag } from '@quenty/servicebag'; + +interface GameConfigAssetClient extends GameConfigAssetBase {} + +interface GameConfigAssetClientConstructor { + readonly ClassName: 'GameConfigAssetClient'; + new (folder: Folder, serviceBag: ServiceBag): GameConfigAssetClient; +} + +export const GameConfigAssetClient: GameConfigAssetClientConstructor; diff --git a/src/gameconfig/src/Client/Config/Config/GameConfigClient.d.ts b/src/gameconfig/src/Client/Config/Config/GameConfigClient.d.ts new file mode 100644 index 00000000000..ac2b40f0be7 --- /dev/null +++ b/src/gameconfig/src/Client/Config/Config/GameConfigClient.d.ts @@ -0,0 +1,15 @@ +import { Binder } from '@quenty/binder'; +import { GameConfigBase } from '@quenty/gameconfig/src/Shared/Config/Config/GameConfigBase'; +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigAssetClient } from '../Asset/GameConfigAssetClient'; + +interface GameConfigClient extends GameConfigBase { + GetGameConfigAssetBinder(): Binder; +} + +interface GameConfigClientConstructor { + readonly ClassName: 'GameConfigClient'; + new (folder: Folder, serviceBag: ServiceBag): GameConfigClient; +} + +export const GameConfigClient: GameConfigClientConstructor; diff --git a/src/gameconfig/src/Client/GameConfigBindersClient.d.ts b/src/gameconfig/src/Client/GameConfigBindersClient.d.ts new file mode 100644 index 00000000000..ba69eb1b316 --- /dev/null +++ b/src/gameconfig/src/Client/GameConfigBindersClient.d.ts @@ -0,0 +1,8 @@ +import { BinderProvider } from '@quenty/binder'; +import { GameConfigClient } from './Config/Config/GameConfigClient'; +import { GameConfigAssetClient } from './Config/Asset/GameConfigAssetClient'; + +export const GameConfigBindersClient: BinderProvider<{ + GameConfig: GameConfigClient; + GameConfigAsset: GameConfigAssetClient; +}>; diff --git a/src/gameconfig/src/Client/GameConfigServiceClient.d.ts b/src/gameconfig/src/Client/GameConfigServiceClient.d.ts new file mode 100644 index 00000000000..9c4bd6f8520 --- /dev/null +++ b/src/gameconfig/src/Client/GameConfigServiceClient.d.ts @@ -0,0 +1,10 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigPicker } from '../Shared/Config/Picker/GameConfigPicker'; + +export interface GameConfigServiceClient { + readonly ServiceName: 'GameConfigServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetConfigPicker(): GameConfigPicker; + Destroy(): void; +} diff --git a/src/gameconfig/src/Server/Cmdr/GameConfigCommandService.d.ts b/src/gameconfig/src/Server/Cmdr/GameConfigCommandService.d.ts new file mode 100644 index 00000000000..b225bf59ed1 --- /dev/null +++ b/src/gameconfig/src/Server/Cmdr/GameConfigCommandService.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface GameConfigCommandService { + readonly ServiceName: 'GameConfigCommandService'; + Init(serviceBag: ServiceBag): void; + Start(): void; +} diff --git a/src/gameconfig/src/Server/Config/Asset/GameConfigAsset.d.ts b/src/gameconfig/src/Server/Config/Asset/GameConfigAsset.d.ts new file mode 100644 index 00000000000..1e7a9c3b713 --- /dev/null +++ b/src/gameconfig/src/Server/Config/Asset/GameConfigAsset.d.ts @@ -0,0 +1,11 @@ +import { GameConfigAssetBase } from '../../../Shared/Config/Asset/GameConfigAssetBase'; +import { ServiceBag } from '@quenty/servicebag'; + +interface GameConfigAsset extends GameConfigAssetBase {} + +interface GameConfigAssetConstructor { + readonly ClassName: 'GameConfigAsset'; + new (obj: Folder, serviceBag: ServiceBag): GameConfigAsset; +} + +export const GameConfigAsset: GameConfigAssetConstructor; diff --git a/src/gameconfig/src/Server/Config/Config/GameConfig.d.ts b/src/gameconfig/src/Server/Config/Config/GameConfig.d.ts new file mode 100644 index 00000000000..f04c6aec74d --- /dev/null +++ b/src/gameconfig/src/Server/Config/Config/GameConfig.d.ts @@ -0,0 +1,15 @@ +import { Binder } from '@quenty/binder'; +import { GameConfigBase } from '../../../Shared/Config/Config/GameConfigBase'; +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigAsset } from '../Asset/GameConfigAsset'; + +interface GameConfig extends GameConfigBase { + GetGameConfigAssetBinder(): Binder; +} + +interface GameConfigConstructor { + readonly ClassName: 'GameConfig'; + new (obj: Instance, serviceBag: ServiceBag): GameConfig; +} + +export const GameConfig: GameConfigConstructor; diff --git a/src/gameconfig/src/Server/GameConfigBindersServer.d.ts b/src/gameconfig/src/Server/GameConfigBindersServer.d.ts new file mode 100644 index 00000000000..bc838f7ffd8 --- /dev/null +++ b/src/gameconfig/src/Server/GameConfigBindersServer.d.ts @@ -0,0 +1,8 @@ +import { BinderProvider } from '@quenty/binder'; +import { GameConfig } from './Config/Config/GameConfig'; +import { GameConfigAsset } from './Config/Asset/GameConfigAsset'; + +export const GameConfigBindersServer: BinderProvider<{ + GameConfig: GameConfig; + GameConfigAsset: GameConfigAsset; +}>; diff --git a/src/gameconfig/src/Server/GameConfigService.d.ts b/src/gameconfig/src/Server/GameConfigService.d.ts new file mode 100644 index 00000000000..3570a5df64e --- /dev/null +++ b/src/gameconfig/src/Server/GameConfigService.d.ts @@ -0,0 +1,24 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigAssetType } from '../Shared/Config/AssetTypes/GameConfigAssetTypes'; +import { GameConfigPicker } from '../Shared/Config/Picker/GameConfigPicker'; + +export interface GameConfigService { + readonly ServiceName: 'GameConfigService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + AddBadge(assetKey: string, badgeId: number): void; + AddProduct(assetKey: string, productId: number): void; + AddPass(assetKey: string, passId: number): void; + AddPlace(assetKey: string, placeId: number): void; + AddAsset(assetKey: string, assetId: number): void; + AddSubscription(assetKey: string, subscriptionId: number): void; + AddBundle(assetKey: string, bundleId: number): void; + AddTypedAsset( + assetType: GameConfigAssetType, + assetKey: string, + assetId: number + ): Folder; + GetConfigPicker(): GameConfigPicker; + GetPreferredParent(): Instance; + Destroy(): void; +} diff --git a/src/gameconfig/src/Server/GameConfigServiceConstants.d.ts b/src/gameconfig/src/Server/GameConfigServiceConstants.d.ts new file mode 100644 index 00000000000..fe4d165095f --- /dev/null +++ b/src/gameconfig/src/Server/GameConfigServiceConstants.d.ts @@ -0,0 +1,3 @@ +export const GameConfigServiceConstants: Readonly<{ + DEFAULT_CONFIG_NAME: 'DefaultGameConfig'; +}>; diff --git a/src/gameconfig/src/Server/Mantle/MantleConfigProvider.d.ts b/src/gameconfig/src/Server/Mantle/MantleConfigProvider.d.ts new file mode 100644 index 00000000000..6af8f16e00e --- /dev/null +++ b/src/gameconfig/src/Server/Mantle/MantleConfigProvider.d.ts @@ -0,0 +1,13 @@ +import { ServiceBag } from '@quenty/servicebag'; + +interface MantleConfigProvider { + Init(serviceBag: ServiceBag): void; + Destroy(): void; +} + +interface MantleConfigProviderConstructor { + readonly ClassName: 'MantleConfigProvider'; + new (container: Instance): MantleConfigProvider; +} + +export const MantleConfigProvider: MantleConfigProviderConstructor; diff --git a/src/gameconfig/src/Shared/Cmdr/GameConfigCmdrUtils.d.ts b/src/gameconfig/src/Shared/Cmdr/GameConfigCmdrUtils.d.ts new file mode 100644 index 00000000000..8cc2244cd7d --- /dev/null +++ b/src/gameconfig/src/Shared/Cmdr/GameConfigCmdrUtils.d.ts @@ -0,0 +1,15 @@ +import { CmdrLike } from '@quenty/cmdrservice'; +import { GameConfigPicker } from '../Config/Picker/GameConfigPicker'; +import { GameConfigAssetType } from '../Config/AssetTypes/GameConfigAssetTypes'; + +export namespace GameConfigCmdrUtils { + function registerAssetTypes( + cmdr: CmdrLike, + configPicker: GameConfigPicker + ): void; + function registerAssetType( + cmdr: CmdrLike, + configPicker: GameConfigPicker, + assetType: GameConfigAssetType + ): void; +} diff --git a/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetBase.d.ts b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetBase.d.ts new file mode 100644 index 00000000000..2fdf418a1d7 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetBase.d.ts @@ -0,0 +1,49 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigAssetType } from '../AssetTypes/GameConfigAssetTypes'; +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; + +export interface GameConfigAssetState { + assetId: number; + assetKey: string; + assetType: GameConfigAssetType; +} + +interface GameConfigAssetBase extends BaseObject { + ObserveTranslatedName(): Observable; + ObserveTranslatedDescription(): Observable; + SetNameTranslationKey(nameTranslationKey: string | undefined): void; + SetDescriptionTranslationKey( + descriptionTranslationKey: string | undefined + ): void; + GetAssetId(): number; + ObserveAssetId(): Observable; + GetAssetType(): GameConfigAssetType | undefined; + ObserveAssetType(): Observable; + ObserveAssetKey(): Observable; + GetAssetKey(): string; + ObserveState(): Observable; + PromiseCloudPriceInRobux( + cancelToken?: CancelToken + ): Promise; + PromiseCloudName(cancelToken?: CancelToken): Promise; + PromiseColor(): Promise; + PromiseNameTranslationKey( + cancelToken?: CancelToken + ): Promise; + ObserveNameTranslationKey(): Observable; + ObserveDescriptionTranslationKey(): Observable; + ObserveCloudName(): Observable; + ObserveCloudDescription(): Observable; + ObserveCloudPriceInRobux(): Observable; + ObserveCloudIconImageAssetId(): Observable; +} + +interface GameConfigAssetBaseConstructor { + readonly ClassName: 'GameConfigAssetBase'; + new (obj: Folder, serviceBag: ServiceBag): GameConfigAssetBase; +} + +export const GameConfigAssetBase: GameConfigAssetBaseConstructor; diff --git a/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetConstants.d.ts b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetConstants.d.ts new file mode 100644 index 00000000000..51535af11d6 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetConstants.d.ts @@ -0,0 +1,4 @@ +export const GameConfigAssetConstants: Readonly<{ + ASSET_TYPE_ATTRIBUTE: 'AssetType'; + ASSET_ID_ATTRIBUTE: 'AssetId'; +}>; diff --git a/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetUtils.d.ts b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetUtils.d.ts new file mode 100644 index 00000000000..e7801c3c4bf --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Asset/GameConfigAssetUtils.d.ts @@ -0,0 +1,31 @@ +import { Binder } from '@quenty/binder'; +import { GameConfigAssetBase } from './GameConfigAssetBase'; +import { GameConfigAssetType } from '../AssetTypes/GameConfigAssetTypes'; +import { ServiceBag } from '@quenty/servicebag'; +import { Promise } from '@quenty/promise'; + +type GameConfigAssetTypeToProductInfo = { + badge: BadgeInfo; + product: DeveloperProductInfo; + pass: GamePassProductInfo; + asset: AssetProductInfo; + bundle: BundleInfo; +}; + +export namespace GameConfigAssetUtils { + function create( + binder: Binder, + assetType: GameConfigAssetType, + assetKey: string, + assetId: number + ): Folder; + function promiseCloudDataForAssetType( + serviceBag: ServiceBag, + assetType: T, + assetId: number + ): Promise< + T extends keyof GameConfigAssetTypeToProductInfo + ? GameConfigAssetTypeToProductInfo[T] + : ProductInfo + >; +} diff --git a/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.d.ts b/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.d.ts new file mode 100644 index 00000000000..ee15a9dc1e0 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.d.ts @@ -0,0 +1,6 @@ +import { GameConfigAssetType } from './GameConfigAssetTypes'; + +export namespace GameConfigAssetTypeUtils { + function isAssetType(value: unknown): value is GameConfigAssetType; + function getPlural(assetType: GameConfigAssetType): string; +} diff --git a/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypes.d.ts b/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypes.d.ts new file mode 100644 index 00000000000..5a62c5aa180 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/AssetTypes/GameConfigAssetTypes.d.ts @@ -0,0 +1,13 @@ +export type GameConfigAssetType = + (typeof GameConfigAssetTypes)[keyof typeof GameConfigAssetTypes]; + +export const GameConfigAssetTypes: Readonly<{ + BADGE: 'badge'; + PRODUCT: 'product'; + PASS: 'pass'; + ASSET: 'asset'; + BUNDLE: 'bundle'; + PLACE: 'place'; + SUBSCRIPTION: 'subscription'; + MEMBERSHIP: 'membership'; +}>; diff --git a/src/gameconfig/src/Shared/Config/Config/GameConfigBase.d.ts b/src/gameconfig/src/Shared/Config/Config/GameConfigBase.d.ts new file mode 100644 index 00000000000..fddbea8808a --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Config/GameConfigBase.d.ts @@ -0,0 +1,45 @@ +import { BaseObject } from '@quenty/baseobject'; +import { GameConfigAssetType } from '../AssetTypes/GameConfigAssetTypes'; +import { GameConfigAssetBase } from '../Asset/GameConfigAssetBase'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +interface GameConfigBase extends BaseObject { + GetFolder(): Folder; + GetAssetsOfType(assetType: GameConfigAssetType): GameConfigAssetBase[]; + GetAssetsOfTypeAndKey( + assetType: GameConfigAssetType, + assetKey: string + ): GameConfigAssetBase[]; + GetAssetsOfTypeAndId( + assetType: GameConfigAssetType, + assetId: number + ): GameConfigAssetBase[]; + ObserveAssetByTypeAndKeyBrio( + assetType: GameConfigAssetType, + assetKey: string + ): Observable>; + ObserveAssetByTypeAndIdBrio( + assetType: GameConfigAssetType, + assetId: number + ): Observable>; + ObserveAssetByIdBrio(assetId: number): Observable>; + ObserveAssetByKeyBrio( + assetKey: string + ): Observable>; + ObserveAssetByTypeBrio( + assetType: GameConfigAssetType + ): Observable>; + InitObservation(): void; + ObserveGameId(): Observable; + GetGameId(): number; + GetConfigName(): string; + ObserveConfigName(): Observable; +} + +interface GameConfigBaseConstructor { + readonly ClassName: 'GameConfigBase'; + new (folder: Folder): GameConfigBase; +} + +export const GameConfigBase: GameConfigBaseConstructor; diff --git a/src/gameconfig/src/Shared/Config/Config/GameConfigConstants.d.ts b/src/gameconfig/src/Shared/Config/Config/GameConfigConstants.d.ts new file mode 100644 index 00000000000..b5bc7315e99 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Config/GameConfigConstants.d.ts @@ -0,0 +1,3 @@ +export const GameConfigConstants: Readonly<{ + GAME_ID_ATTRIBUTE: 'GameId'; +}>; diff --git a/src/gameconfig/src/Shared/Config/Config/GameConfigUtils.d.ts b/src/gameconfig/src/Shared/Config/Config/GameConfigUtils.d.ts new file mode 100644 index 00000000000..daa83937f92 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Config/GameConfigUtils.d.ts @@ -0,0 +1,17 @@ +import { Binder } from '@quenty/binder'; +import { GameConfigBase } from './GameConfigBase'; +import { GameConfigAssetType } from '../AssetTypes/GameConfigAssetTypes'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export namespace GameConfigUtils { + function create(binder: Binder, gameId: number): Folder; + function getOrCreateAssetFolder( + config: Folder, + assetType: GameConfigAssetType + ): Folder; + function observeAssetFolderBrio( + config: Folder, + assetType: GameConfigAssetType + ): Observable>; +} diff --git a/src/gameconfig/src/Shared/Config/Picker/GameConfigPicker.d.ts b/src/gameconfig/src/Shared/Config/Picker/GameConfigPicker.d.ts new file mode 100644 index 00000000000..a402a063b65 --- /dev/null +++ b/src/gameconfig/src/Shared/Config/Picker/GameConfigPicker.d.ts @@ -0,0 +1,65 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigAssetType } from '../AssetTypes/GameConfigAssetTypes'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { GameConfigAssetBase } from '../Asset/GameConfigAssetBase'; +import { Promise } from '@quenty/promise'; +import { GameConfigBase } from '../Config/GameConfigBase'; + +interface GameConfigPicker extends BaseObject { + ObserveActiveAssetOfTypeBrio( + assetType: GameConfigAssetType + ): Observable>; + ObserveActiveAssetOfAssetTypeAndKeyBrio( + assetType: GameConfigAssetType, + assetKey: string + ): Observable>; + ObserveActiveAssetOfAssetTypeAndIdBrio( + assetType: GameConfigAssetType, + assetId: number + ): Observable>; + ObserveActiveAssetOfAssetIdBrio( + assetId: number + ): Observable>; + ObserveActiveAssetOfKeyBrio( + assetKey: string + ): Observable>; + ObserveActiveConfigsBrio(): Observable>; + GetActiveConfigs(): GameConfigAssetBase[]; + FindFirstActiveAssetOfId( + assetType: GameConfigAssetType, + assetId: number + ): GameConfigAssetBase | undefined; + PromisePriceInRobux( + assetType: GameConfigAssetType, + assetIdOrKey: number | string + ): Promise; + FindFirstActiveAssetOfKey( + assetType: GameConfigAssetType, + assetKey: string + ): GameConfigAssetBase | undefined; + GetAllActiveAssetsOfType( + assetType: GameConfigAssetType + ): GameConfigAssetBase[]; + ToAssetId( + assetType: GameConfigAssetType, + assetIdOrKey: number | string + ): number | undefined; + ObserveToAssetIdBrio( + assetType: GameConfigAssetType, + assetIdOrKey: number | string + ): Observable>; +} + +interface GameConfigPickerConstructor { + readonly ClassName: 'GameConfigPicker'; + new ( + serviceBag: ServiceBag, + gameConfigBinder: Binder, + gameConfigAssetBinder: Binder + ): GameConfigPicker; +} + +export const GameConfigPicker: GameConfigPickerConstructor; diff --git a/src/gameconfig/src/Shared/GameConfigDataService.d.ts b/src/gameconfig/src/Shared/GameConfigDataService.d.ts new file mode 100644 index 00000000000..28d9c1b6d1b --- /dev/null +++ b/src/gameconfig/src/Shared/GameConfigDataService.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { GameConfigPicker } from './Config/Picker/GameConfigPicker'; + +export interface GameConfigDataService { + readonly ServiceName: 'GameConfigDataService'; + Init(serviceBag: ServiceBag): void; + SetConfigPicker(configPicker: GameConfigPicker): void; + GetConfigPicker(): GameConfigPicker; +} diff --git a/src/gameconfig/src/Shared/GameConfigTranslator.d.ts b/src/gameconfig/src/Shared/GameConfigTranslator.d.ts new file mode 100644 index 00000000000..5aa0240ee45 --- /dev/null +++ b/src/gameconfig/src/Shared/GameConfigTranslator.d.ts @@ -0,0 +1,3 @@ +import { JSONTranslator } from '@quenty/clienttranslator'; + +export const GameConfigTranslator: JSONTranslator; diff --git a/src/gameproductservice/index.d.ts b/src/gameproductservice/index.d.ts new file mode 100644 index 00000000000..7641a2f231b --- /dev/null +++ b/src/gameproductservice/index.d.ts @@ -0,0 +1,11 @@ +export * from './src/Client/GameProductServiceClient'; +export * from './src/Client/Manager/PlayerProductManagerClient'; +export * from './src/Server/Cmdr/GameProductCmdrService'; +export * from './src/Server/GameProductService'; +export * from './src/Server/Manager/PlayerProductManager'; +export * from './src/Shared/GameProductDataService'; +export * from './src/Shared/Interfaces/PlayerAssetMarketTrackerInterface'; +export * from './src/Shared/Interfaces/PlayerProductManagerInterface'; +export * from './src/Shared/Ownership/PlayerAssetOwnershipTracker'; +export * from './src/Shared/Trackers/PlayerAssetMarketTracker'; +export * from './src/Shared/Trackers/PlayerProductManagerBase'; diff --git a/src/gameproductservice/src/Client/GameProductServiceClient.d.ts b/src/gameproductservice/src/Client/GameProductServiceClient.d.ts new file mode 100644 index 00000000000..7e21327acbe --- /dev/null +++ b/src/gameproductservice/src/Client/GameProductServiceClient.d.ts @@ -0,0 +1,57 @@ +import { GameConfigAssetType } from '@quenty/gameconfig'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +export interface GameProductServiceClient { + readonly ServiceName: 'GameProductServiceClient'; + GamePassPurchased: Signal; + ProductPurchased: Signal; + AssetPurchased: Signal; + BundlePurchased: Signal; + SubscriptionPurchased: Signal; + MembershipPurchased: Signal; + Init(serviceBag: ServiceBag): void; + Start(): void; + ObservePlayerAssetPurchased( + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + ObserveAssetPurchased( + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + HasPlayerPurchasedThisSession( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): boolean; + PromisePromptPurchase( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromisePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + ObservePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + PromisePlayerIsPromptOpen(player: Player): Promise; + PromisePlayerPromptClosed(player: Player): Promise; + PromisePlayerOwnershipOrPrompt( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromiseGamePassOrProductUnlockOrPrompt( + gamePassIdOrKey: number | string, + productIdOrKey: number | string + ): Promise; + Destroy(): void; +} diff --git a/src/gameproductservice/src/Client/Manager/PlayerProductManagerClient.d.ts b/src/gameproductservice/src/Client/Manager/PlayerProductManagerClient.d.ts new file mode 100644 index 00000000000..a40d178feb1 --- /dev/null +++ b/src/gameproductservice/src/Client/Manager/PlayerProductManagerClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerProductManagerBase } from '../../Shared/Trackers/PlayerProductManagerBase'; +import { Binder } from '@quenty/binder'; + +interface PlayerProductManagerClient extends PlayerProductManagerBase {} + +interface PlayerProductManagerClientConstructor { + readonly ClassName: 'PlayerProductManagerClient'; + new (obj: Player, serviceBag: ServiceBag): PlayerProductManagerClient; +} + +export const PlayerProductManagerClient: Binder; diff --git a/src/gameproductservice/src/Server/Cmdr/GameProductCmdrService.d.ts b/src/gameproductservice/src/Server/Cmdr/GameProductCmdrService.d.ts new file mode 100644 index 00000000000..b8cb0cf9f6b --- /dev/null +++ b/src/gameproductservice/src/Server/Cmdr/GameProductCmdrService.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface GameProductCmdrService { + readonly ServiceName: 'GameProductCmdrService'; + Init(serviceBag: ServiceBag): void; + Start(): void; +} diff --git a/src/gameproductservice/src/Server/GameProductService.d.ts b/src/gameproductservice/src/Server/GameProductService.d.ts new file mode 100644 index 00000000000..6b638fb2dde --- /dev/null +++ b/src/gameproductservice/src/Server/GameProductService.d.ts @@ -0,0 +1,53 @@ +import { GameConfigAssetType } from '@quenty/gameconfig'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +export interface GameProductService { + readonly ServiceName: 'GameProductService'; + GamePassPurchased: Signal<[player: Player, gamePassId: number]>; + ProductPurchased: Signal<[player: Player, productId: number]>; + AssetPurchased: Signal<[player: Player, assetId: number]>; + BundlePurchased: Signal<[player: Player, bundleId: number]>; + MembershipPurchased: Signal<[player: Player, membershipId: number]>; + SubscriptionPurchased: Signal<[player: Player, subscriptionId: number]>; + Init(serviceBag: ServiceBag): void; + ObservePlayerAssetPurchased( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + ObserveAssetPurchased( + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + HasPlayerPurchasedThisSession( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): boolean; + PromisePlayerIsPromptOpen(player: Player): Promise; + PromisePlayerPromptClosed(player: Player): Promise; + PromisePlayerPromptPurchase( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromisePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromisePlayerOwnershipOrPrompt( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + ObservePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + Destroy(): void; +} diff --git a/src/gameproductservice/src/Server/Manager/PlayerProductManager.d.ts b/src/gameproductservice/src/Server/Manager/PlayerProductManager.d.ts new file mode 100644 index 00000000000..ac3570ec7cb --- /dev/null +++ b/src/gameproductservice/src/Server/Manager/PlayerProductManager.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerProductManagerBase } from '../../Shared/Trackers/PlayerProductManagerBase'; +import { PlayerBinder } from '@quenty/playerbinder'; + +interface PlayerProductManager extends PlayerProductManagerBase {} + +interface PlayerProductManagerConstructor { + readonly ClassName: 'PlayerProductManager'; + new (player: Player, serviceBag: ServiceBag): PlayerProductManager; +} + +export const PlayerProductManager: PlayerBinder; diff --git a/src/gameproductservice/src/Shared/GameProductDataService.d.ts b/src/gameproductservice/src/Shared/GameProductDataService.d.ts new file mode 100644 index 00000000000..7b26628e111 --- /dev/null +++ b/src/gameproductservice/src/Shared/GameProductDataService.d.ts @@ -0,0 +1,58 @@ +import { GameConfigAssetType } from '@quenty/gameconfig'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; + +export interface GameProductDataService { + readonly ServiceName: 'GameProductDataService'; + GamePassPurchased: Signal<[player: Player, gamePassId: number]>; + ProductPurchased: Signal<[player: Player, productId: number]>; + AssetPurchased: Signal<[player: Player, assetId: number]>; + BundlePurchased: Signal<[player: Player, bundleId: number]>; + MembershipPurchased: Signal<[player: Player, membershipId: number]>; + SubscriptionPurchased: Signal<[player: Player, subscriptionId: number]>; + Init(serviceBag: ServiceBag): void; + Start(): void; + HasPlayerPurchasedThisSession( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): boolean; + PromisePromptPurchase( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromisePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + PromiseIsOwnable( + player: Player, + assetType: GameConfigAssetType + ): Promise; + PromisePlayerIsPromptOpen(player: Player): Promise; + PromisePlayerPromptClosed(player: Player): Promise; + ObservePlayerOwnership( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + ObservePlayerAssetPurchased( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + ObserveAssetPurchased( + assetType: GameConfigAssetType, + idOrKey: number | string + ): Observable; + PromisePlayerOwnershipOrPrompt( + player: Player, + assetType: GameConfigAssetType, + idOrKey: number | string + ): Promise; + Destroy(): void; +} diff --git a/src/gameproductservice/src/Shared/Interfaces/PlayerAssetMarketTrackerInterface.d.ts b/src/gameproductservice/src/Shared/Interfaces/PlayerAssetMarketTrackerInterface.d.ts new file mode 100644 index 00000000000..0dc1f626b2c --- /dev/null +++ b/src/gameproductservice/src/Shared/Interfaces/PlayerAssetMarketTrackerInterface.d.ts @@ -0,0 +1,17 @@ +import { + TieDefinition, + TieDefinitionMethod, + TieDefinitionSignal, +} from '@quenty/tie'; + +export const PlayerAssetMarketTrackerInterface: TieDefinition<{ + ObservePromptOpenCount: TieDefinitionMethod; + ObserveAssetPurchased: TieDefinitionMethod; + PromisePromptPurchase: TieDefinitionMethod; + HasPurchasedThisSession: TieDefinitionMethod; + IsPromptOpen: TieDefinitionMethod; + + Purchased: TieDefinitionSignal; + PromptClosed: TieDefinitionSignal; + ShowPromptRequested: TieDefinitionSignal; +}>; diff --git a/src/gameproductservice/src/Shared/Interfaces/PlayerProductManagerInterface.d.ts b/src/gameproductservice/src/Shared/Interfaces/PlayerProductManagerInterface.d.ts new file mode 100644 index 00000000000..963f19e665a --- /dev/null +++ b/src/gameproductservice/src/Shared/Interfaces/PlayerProductManagerInterface.d.ts @@ -0,0 +1,10 @@ +import { TieDefinition, TieDefinitionMethod } from '@quenty/tie'; + +export const PlayerProductManagerInterface: TieDefinition<{ + GetPlayer: TieDefinitionMethod; + IsOwnable: TieDefinitionMethod; + IsPromptOpen: TieDefinitionMethod; + PromisePlayerPromptClosed: TieDefinitionMethod; + GetAssetTrackerOrError: TieDefinitionMethod; + GetOwnershipTrackerOrError: TieDefinitionMethod; +}>; diff --git a/src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.d.ts b/src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.d.ts new file mode 100644 index 00000000000..4cea17b0ae4 --- /dev/null +++ b/src/gameproductservice/src/Shared/Ownership/PlayerAssetOwnershipTracker.d.ts @@ -0,0 +1,20 @@ +interface PlayerAssetOwnershipTracker { + SetParent(parent?: Instance): void; + Show(): void; + Set(a: Vector2, b: Vector2, c: Vector2): this; + Hide(): void; + SetA(a: Vector2): this; + SetB(b: Vector2): this; + SetC(c: Vector2): this; + UpdateRender(): void; + Destroy(): void; +} + +interface PlayerAssetOwnershipTrackerConstructor { + readonly ClassName: 'PlayerAssetOwnershipTracker'; + new (parent?: Instance): PlayerAssetOwnershipTracker; + + ExtraPixels: 2; +} + +export const PlayerAssetOwnershipTracker: PlayerAssetOwnershipTrackerConstructor; diff --git a/src/gameproductservice/src/Shared/Trackers/PlayerAssetMarketTracker.d.ts b/src/gameproductservice/src/Shared/Trackers/PlayerAssetMarketTracker.d.ts new file mode 100644 index 00000000000..936acc91cfb --- /dev/null +++ b/src/gameproductservice/src/Shared/Trackers/PlayerAssetMarketTracker.d.ts @@ -0,0 +1,36 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Brio } from '@quenty/brio'; +import { GameConfigAssetType } from '@quenty/gameconfig'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { PlayerAssetOwnershipTracker } from '../Ownership/PlayerAssetOwnershipTracker'; +import { Promise } from '@quenty/promise'; + +interface PlayerAssetMarketTracker extends BaseObject { + Purchased: Signal; + PromptClosed: Signal<[id: number, isPurchased: boolean]>; + ShowPromptRequested: Signal; + ObservePromptOpenCount(): Observable; + ObserveAssetPurchased(idOrKey: number | string): Observable; + GetOwnershipTracker(): PlayerAssetOwnershipTracker | undefined; + PromisePromptPurchase(idOrKey: number | string): Promise; + SetOwnershipTracker( + ownershipTracker: PlayerAssetOwnershipTracker | undefined + ): void; + GetAssetType(): GameConfigAssetType; + HasPurchasedThisSession(idOrKey: number | string): boolean; + IsPromptOpen(): boolean; + HandlePurchaseEvent(id: number, isPurchased: boolean): void; + HandlePromptClosedEvent(id: number): void; +} + +interface PlayerAssetMarketTrackerConstructor { + readonly ClassName: 'PlayerAssetMarketTracker'; + new ( + assetType: GameConfigAssetType, + convertIds: (idOrKey: number | string) => number | undefined, + observeIdsBrio: (idOrKey: number | string) => Observable> + ): PlayerAssetMarketTracker; +} + +export const PlayerAssetMarketTracker: PlayerAssetMarketTrackerConstructor; diff --git a/src/gameproductservice/src/Shared/Trackers/PlayerProductManagerBase.d.ts b/src/gameproductservice/src/Shared/Trackers/PlayerProductManagerBase.d.ts new file mode 100644 index 00000000000..b74c1f7701d --- /dev/null +++ b/src/gameproductservice/src/Shared/Trackers/PlayerProductManagerBase.d.ts @@ -0,0 +1,27 @@ +import { BaseObject } from '@quenty/baseobject'; +import { GameConfigAssetType } from '@quenty/gameconfig'; +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerAssetMarketTracker } from './PlayerAssetMarketTracker'; +import { PlayerAssetOwnershipTracker } from '../Ownership/PlayerAssetOwnershipTracker'; + +interface PlayerProductManagerBase extends BaseObject { + ExportMarketTrackers(parent: Instance): void; + GetPlayer(): Player; + IsOwnable(assetType: GameConfigAssetType): boolean; + IsPromptOpen(): boolean; + PromisePlayerPromptClosed(): Promise; + GetAssetTrackerOrError( + assetType: GameConfigAssetType + ): PlayerAssetMarketTracker; + GetOwnershipTrackerOrError( + assetType: GameConfigAssetType + ): PlayerAssetOwnershipTracker; +} + +interface PlayerProductManagerBaseConstructor { + readonly ClassName: 'PlayerProductManagerBase'; + new (player: Player, serviceBag: ServiceBag): PlayerProductManagerBase; +} + +export const PlayerProductManagerBase: PlayerProductManagerBaseConstructor; diff --git a/src/gamescalingutils/index.d.ts b/src/gamescalingutils/index.d.ts new file mode 100644 index 00000000000..b4fa25cf31c --- /dev/null +++ b/src/gamescalingutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/GameScalingHelper'; +export * from './src/Client/GameScalingUtils'; diff --git a/src/gamescalingutils/src/Client/GameScalingHelper.d.ts b/src/gamescalingutils/src/Client/GameScalingHelper.d.ts new file mode 100644 index 00000000000..65759aaed46 --- /dev/null +++ b/src/gamescalingutils/src/Client/GameScalingHelper.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface GameScalingHelper extends BaseObject { + ObserveIsSmall(): Observable; + ObserveIsVertical(): Observable; + GetAbsoluteSizeSetter(): (absoluteSize: Vector2) => void; + SetAbsoluteSize(absoluteSize: Vector2 | Observable): void; + SetScreenGui(screenGui: ScreenGui): () => void; +} + +interface GameScalingHelperConstructor { + readonly ClassName: 'GameScalingHelper'; + new (screenGui: ScreenGui): GameScalingHelper; +} + +export const GameScalingHelper: GameScalingHelperConstructor; diff --git a/src/gamescalingutils/src/Client/GameScalingUtils.d.ts b/src/gamescalingutils/src/Client/GameScalingUtils.d.ts new file mode 100644 index 00000000000..044905b4035 --- /dev/null +++ b/src/gamescalingutils/src/Client/GameScalingUtils.d.ts @@ -0,0 +1,15 @@ +import { Observable } from '@quenty/rx'; + +export namespace GameScalingUtils { + function getUIScale(screenAbsoluteSize: Vector2): number; + function observeUIScale(screenGui: ScreenGui): Observable; + function observeUIScaleForChild(child: Instance): Observable; + function renderUIScale(props: { + [key: string]: unknown; + }): Observable; + function renderDialogPadding(props: { + [key: string]: unknown; + }): Observable; + function observeDialogPadding(screenGui: ScreenGui): Observable; + function getDialogPadding(screenAbsoluteSize: Vector2): number; +} diff --git a/src/gameversionutils/index.d.ts b/src/gameversionutils/index.d.ts new file mode 100644 index 00000000000..735126093d4 --- /dev/null +++ b/src/gameversionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/GameVersionUtils'; diff --git a/src/gameversionutils/src/Server/GameVersionUtils.d.ts b/src/gameversionutils/src/Server/GameVersionUtils.d.ts new file mode 100644 index 00000000000..5b1ed4be098 --- /dev/null +++ b/src/gameversionutils/src/Server/GameVersionUtils.d.ts @@ -0,0 +1,5 @@ +export namespace GameVersionUtils { + function getBuild(): string; + function getBuildWithServerType(): string; + function isVIPServer(): boolean; +} diff --git a/src/generatewithmixin/index.d.ts b/src/generatewithmixin/index.d.ts new file mode 100644 index 00000000000..7e6a57dbfc2 --- /dev/null +++ b/src/generatewithmixin/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/GenerateWithMixin'; diff --git a/src/generatewithmixin/src/Shared/GenerateWithMixin.d.ts b/src/generatewithmixin/src/Shared/GenerateWithMixin.d.ts new file mode 100644 index 00000000000..dde8bf062b2 --- /dev/null +++ b/src/generatewithmixin/src/Shared/GenerateWithMixin.d.ts @@ -0,0 +1,8 @@ +export interface GenerateWithMixin {} + +export const GenerateWithMixin: { + Add( + classObj: { new (...args: unknown[]): unknown }, + staticResources: string[] + ): void; +}; diff --git a/src/genericscreenguiprovider/index.d.ts b/src/genericscreenguiprovider/index.d.ts new file mode 100644 index 00000000000..c99568b4901 --- /dev/null +++ b/src/genericscreenguiprovider/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/GenericScreenGuiProvider'; +export * from './src/Client/ScreenGuiService'; diff --git a/src/genericscreenguiprovider/src/Client/GenericScreenGuiProvider.d.ts b/src/genericscreenguiprovider/src/Client/GenericScreenGuiProvider.d.ts new file mode 100644 index 00000000000..03b7d801e18 --- /dev/null +++ b/src/genericscreenguiprovider/src/Client/GenericScreenGuiProvider.d.ts @@ -0,0 +1,24 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { Mountable } from '@quenty/valueobject'; + +interface GenericScreenGuiProvider | unknown> { + Init(serviceBag: ServiceBag): void; + Start(): void; + ObserveScreenGui(orderName: keyof T): Observable; + SetDisplayOrder(orderName: keyof T, order: Mountable): () => void; + Get(orderName: keyof T): ScreenGui | Frame; + GetDisplayOrder(orderName: keyof T): number; + ObserveDisplayOrder(orderName: keyof T): Observable; + Destroy(): void; +} + +interface GenericScreenGuiProviderConstructor { + readonly ClassName: 'GenericScreenGuiProvider'; + readonly ServiceName: 'GenericScreenGuiProvider'; + new >( + orders: T + ): GenericScreenGuiProvider; +} + +export const GenericScreenGuiProvider: GenericScreenGuiProviderConstructor; diff --git a/src/genericscreenguiprovider/src/Client/ScreenGuiService.d.ts b/src/genericscreenguiprovider/src/Client/ScreenGuiService.d.ts new file mode 100644 index 00000000000..88335d6681e --- /dev/null +++ b/src/genericscreenguiprovider/src/Client/ScreenGuiService.d.ts @@ -0,0 +1,11 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface ScreenGuiService { + readonly ServiceName: 'ScreenGuiService'; + Init(serviceBag: ServiceBag): void; + GetGuiParent(): Instance | undefined; + SetGuiParent(playerGui: Instance): () => void; + ObservePlayerGui(): Observable; + Destroy(): void; +} diff --git a/src/geometryutils/index.d.ts b/src/geometryutils/index.d.ts new file mode 100644 index 00000000000..98460c880b6 --- /dev/null +++ b/src/geometryutils/index.d.ts @@ -0,0 +1,9 @@ +export * from './src/Shared/CameraPyramidUtils'; +export * from './src/Shared/CircleUtils'; +export * from './src/Shared/Line'; +export * from './src/Shared/OrthogonalUtils'; +export * from './src/Shared/PlaneUtils'; +export * from './src/Shared/ScaleModelUtils'; +export * from './src/Shared/SphereUtils'; +export * from './src/Shared/SurfaceUtils'; +export * from './src/Shared/SwingTwistUtils'; diff --git a/src/geometryutils/src/Shared/CameraPyramidUtils.d.ts b/src/geometryutils/src/Shared/CameraPyramidUtils.d.ts new file mode 100644 index 00000000000..ac449be9066 --- /dev/null +++ b/src/geometryutils/src/Shared/CameraPyramidUtils.d.ts @@ -0,0 +1,10 @@ +import { Maid } from '@quenty/maid'; + +export namespace CameraPyramidUtils { + function rayIntersection( + camera: Camera, + rayOrigin: Vector3, + unitRayDirection: Vector3, + debugMaid?: Maid + ): LuaTuple<[first: Vector3, second: Vector3]>; +} diff --git a/src/geometryutils/src/Shared/CircleUtils.d.ts b/src/geometryutils/src/Shared/CircleUtils.d.ts new file mode 100644 index 00000000000..adcf12c890d --- /dev/null +++ b/src/geometryutils/src/Shared/CircleUtils.d.ts @@ -0,0 +1,7 @@ +export namespace CircleUtils { + function updatePositionToSmallestDistOnCircle( + position: number, + target: number, + circumference: number + ): number; +} diff --git a/src/geometryutils/src/Shared/Line.d.ts b/src/geometryutils/src/Shared/Line.d.ts new file mode 100644 index 00000000000..db17d96aa76 --- /dev/null +++ b/src/geometryutils/src/Shared/Line.d.ts @@ -0,0 +1,8 @@ +export namespace Line { + function intersection( + a: Vector3, + r: Vector3, + b: Vector3, + s: Vector3 + ): LuaTuple<[p0: Vector3, p1: Vector3]>; +} diff --git a/src/geometryutils/src/Shared/OrthogonalUtils.d.ts b/src/geometryutils/src/Shared/OrthogonalUtils.d.ts new file mode 100644 index 00000000000..a4f430874c4 --- /dev/null +++ b/src/geometryutils/src/Shared/OrthogonalUtils.d.ts @@ -0,0 +1,8 @@ +export namespace OrthogonalUtils { + function decomposeCFrameToVectors(cframe: CFrame): Vector3[]; + function getClosestVector( + options: Vector3[], + unitVector: Vector3 + ): Vector3 | undefined; + function snapCFrameTo(cframe: CFrame, snapToCFrame: CFrame): CFrame; +} diff --git a/src/geometryutils/src/Shared/PlaneUtils.d.ts b/src/geometryutils/src/Shared/PlaneUtils.d.ts new file mode 100644 index 00000000000..1f16bfb423a --- /dev/null +++ b/src/geometryutils/src/Shared/PlaneUtils.d.ts @@ -0,0 +1,8 @@ +export namespace PlaneUtils { + function rayIntersection( + origin: Vector3, + normal: Vector3, + rayOrigin: Vector3, + unitRayDirection: Vector3 + ): LuaTuple<[position: Vector3 | undefined, distance: number | undefined]>; +} diff --git a/src/geometryutils/src/Shared/ScaleModelUtils.d.ts b/src/geometryutils/src/Shared/ScaleModelUtils.d.ts new file mode 100644 index 00000000000..55f00e1e0b0 --- /dev/null +++ b/src/geometryutils/src/Shared/ScaleModelUtils.d.ts @@ -0,0 +1,14 @@ +export namespace ScaleModelUtils { + function scalePartSize(part: BasePart, scale: Vector3 | number): void; + function scalePart( + part: BasePart, + scale: Vector3 | number, + centroid: Vector3 + ): void; + function scale( + parts: BasePart[], + scale: Vector3 | number, + centroid: Vector3 + ): void; + function createMeshFromPart(part: BasePart): FileMesh | undefined; +} diff --git a/src/geometryutils/src/Shared/SphereUtils.d.ts b/src/geometryutils/src/Shared/SphereUtils.d.ts new file mode 100644 index 00000000000..63195b62f2b --- /dev/null +++ b/src/geometryutils/src/Shared/SphereUtils.d.ts @@ -0,0 +1,8 @@ +export namespace SphereUtils { + function intersectsRay( + sphereCenter: Vector3, + sphereRadius: number, + rayOrigin: Vector3, + rayDirection: Vector3 + ): boolean; +} diff --git a/src/geometryutils/src/Shared/SurfaceUtils.d.ts b/src/geometryutils/src/Shared/SurfaceUtils.d.ts new file mode 100644 index 00000000000..5750cc06845 --- /dev/null +++ b/src/geometryutils/src/Shared/SurfaceUtils.d.ts @@ -0,0 +1,3 @@ +export namespace SurfaceUtils { + function getSurfaceCFrame(part: BasePart, lnormal: Vector3): CFrame; +} diff --git a/src/geometryutils/src/Shared/SwingTwistUtils.d.ts b/src/geometryutils/src/Shared/SwingTwistUtils.d.ts new file mode 100644 index 00000000000..18be33791e3 --- /dev/null +++ b/src/geometryutils/src/Shared/SwingTwistUtils.d.ts @@ -0,0 +1,7 @@ +export namespace SwingTwistUtils { + function swingTwist( + cf: CFrame, + direction: Vector3 + ): LuaTuple<[swing: CFrame, twist: CFrame]>; + function twistAngle(cf: CFrame, direction: Vector3): number; +} diff --git a/src/getgroundplane/index.d.ts b/src/getgroundplane/index.d.ts new file mode 100644 index 00000000000..622b678b311 --- /dev/null +++ b/src/getgroundplane/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/batchRaycast'; +export * from './src/Shared/getGroundPlane'; diff --git a/src/getgroundplane/src/Shared/batchRaycast.d.ts b/src/getgroundplane/src/Shared/batchRaycast.d.ts new file mode 100644 index 00000000000..5d6e5415b3d --- /dev/null +++ b/src/getgroundplane/src/Shared/batchRaycast.d.ts @@ -0,0 +1,7 @@ +export const batchRaycast: ( + originList: Vector3[], + directionList: Vector3[], + ignoreListWorkingEnvironment: Instance[], + ignoreFunc: (instance: Instance) => boolean, + keepIgnoreListChanges: boolean +) => RaycastResult[]; diff --git a/src/getgroundplane/src/Shared/getGroundPlane.d.ts b/src/getgroundplane/src/Shared/getGroundPlane.d.ts new file mode 100644 index 00000000000..16b217901e4 --- /dev/null +++ b/src/getgroundplane/src/Shared/getGroundPlane.d.ts @@ -0,0 +1,8 @@ +export const getGroundPlane: ( + basis: CFrame, + radius: number, + length: number, + sampleCount: number, + ignoreList: Instance[], + ignoreFunc: (instance: Instance) => boolean +) => LuaTuple<[position: Vector3, normal: Vector3]>; diff --git a/src/getmechanismparts/index.d.ts b/src/getmechanismparts/index.d.ts new file mode 100644 index 00000000000..7689a5fb8e6 --- /dev/null +++ b/src/getmechanismparts/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/getMechanismParts'; diff --git a/src/getmechanismparts/src/Shared/getMechanismParts.d.ts b/src/getmechanismparts/src/Shared/getMechanismParts.d.ts new file mode 100644 index 00000000000..ccc2ca93996 --- /dev/null +++ b/src/getmechanismparts/src/Shared/getMechanismParts.d.ts @@ -0,0 +1,3 @@ +export const getMechanismParts: ( + originParts: Instance | BasePart[] +) => BasePart[]; diff --git a/src/getpercentexposedutils/index.d.ts b/src/getpercentexposedutils/index.d.ts new file mode 100644 index 00000000000..5cfb34a912e --- /dev/null +++ b/src/getpercentexposedutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/GetPercentExposedUtils'; diff --git a/src/getpercentexposedutils/src/Shared/GetPercentExposedUtils.d.ts b/src/getpercentexposedutils/src/Shared/GetPercentExposedUtils.d.ts new file mode 100644 index 00000000000..9dd6beb8637 --- /dev/null +++ b/src/getpercentexposedutils/src/Shared/GetPercentExposedUtils.d.ts @@ -0,0 +1,11 @@ +import { Raycaster } from '@quenty/raycaster'; + +export namespace GetPercentExposedUtils { + const RAY_COUNT: 314; + + function search( + point: Vector3, + radius: number, + raycaster?: Raycaster + ): Map; +} diff --git a/src/grouputils/index.d.ts b/src/grouputils/index.d.ts new file mode 100644 index 00000000000..ac1b3711b1f --- /dev/null +++ b/src/grouputils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/GroupUtils'; diff --git a/src/grouputils/src/Shared/GroupUtils.d.ts b/src/grouputils/src/Shared/GroupUtils.d.ts new file mode 100644 index 00000000000..3b82a3a2f43 --- /dev/null +++ b/src/grouputils/src/Shared/GroupUtils.d.ts @@ -0,0 +1,16 @@ +import { Promise } from '@quenty/promise'; + +interface RoleInfo { + Name: string; + Rank: number; +} + +export namespace GroupUtils { + function promiseRankInGroup(player: Player, groupId: number): Promise; + function promiseRoleInGroup(player: Player, groupId: number): Promise; + function promiseGroupInfo(groupId: number): Promise; + function promiseGroupRoleInfo( + groupId: number, + rankId: number + ): Promise; +} diff --git a/src/guitriangle/index.d.ts b/src/guitriangle/index.d.ts new file mode 100644 index 00000000000..4bfbbec4a98 --- /dev/null +++ b/src/guitriangle/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/GuiTriangle'; diff --git a/src/guitriangle/src/Client/GuiTriangle.d.ts b/src/guitriangle/src/Client/GuiTriangle.d.ts new file mode 100644 index 00000000000..37581aadb03 --- /dev/null +++ b/src/guitriangle/src/Client/GuiTriangle.d.ts @@ -0,0 +1,20 @@ +interface GuiTriangle { + SetParent(parent?: Instance): void; + Show(): void; + Set(a: Vector2, b: Vector2, c: Vector2): this; + Hide(): void; + SetA(a: Vector2): this; + SetB(b: Vector2): this; + SetC(c: Vector2): this; + UpdateRender(): void; + Destroy(): void; +} + +interface GuiTriangleConstructor { + readonly ClassName: 'GuiTriangle'; + new (parent?: Instance): GuiTriangle; + + ExtraPixels: 2; +} + +export const GuiTriangle: GuiTriangleConstructor; diff --git a/src/guivisiblemanager/index.d.ts b/src/guivisiblemanager/index.d.ts new file mode 100644 index 00000000000..cb6a49de75f --- /dev/null +++ b/src/guivisiblemanager/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/GuiVisibleManager'; diff --git a/src/guivisiblemanager/src/Client/GuiVisibleManager.d.ts b/src/guivisiblemanager/src/Client/GuiVisibleManager.d.ts new file mode 100644 index 00000000000..943793e4baa --- /dev/null +++ b/src/guivisiblemanager/src/Client/GuiVisibleManager.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { BasicPane } from '@quenty/basicpane'; +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; +import { Signal } from '@quenty/signal'; + +interface GuiVisibleManager extends BaseObject { + PaneVisibleChanged: Signal; + IsVisible(): boolean; + BindToBoolValue(boolValue: BoolValue): void; + CreateShowHandle(doNotAnimate?: boolean): { Destroy(): void }; +} + +interface GuiVisibleManagerConstructor { + readonly ClassName: 'GuiVisibleManager'; + new ( + promiseNewPane: (maid: Maid) => Promise, + maxHideTime?: number + ): GuiVisibleManager; +} + +export const GuiVisibleManager: GuiVisibleManagerConstructor; diff --git a/src/hapticfeedbackutils/index.d.ts b/src/hapticfeedbackutils/index.d.ts new file mode 100644 index 00000000000..25598e62939 --- /dev/null +++ b/src/hapticfeedbackutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/HapticFeedbackUtils'; diff --git a/src/hapticfeedbackutils/src/Client/HapticFeedbackUtils.d.ts b/src/hapticfeedbackutils/src/Client/HapticFeedbackUtils.d.ts new file mode 100644 index 00000000000..f456e9f8d17 --- /dev/null +++ b/src/hapticfeedbackutils/src/Client/HapticFeedbackUtils.d.ts @@ -0,0 +1,20 @@ +export namespace HapticFeedbackUtils { + function smallVibrate( + userInputType: Enum.UserInputType, + length?: number, + amplitude?: number + ): void; + function setSmallVibration( + userInputType: Enum.UserInputType, + amplitude: number + ): boolean; + function setLargeVibration( + userInputType: Enum.UserInputType, + amplitude: number + ): boolean; + function setVibrationMotor( + userInputType: Enum.UserInputType, + vibrationMotor: Enum.VibrationMotor, + amplitude: number + ): boolean; +} diff --git a/src/hide/index.d.ts b/src/hide/index.d.ts new file mode 100644 index 00000000000..d848d20b3b7 --- /dev/null +++ b/src/hide/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/HideClient'; +export * from './src/Client/HideServiceClient'; +export * from './src/Server/Hide'; +export * from './src/Server/HideService'; +export * from './src/Shared/HideUtils'; diff --git a/src/hide/src/Client/HideClient.d.ts b/src/hide/src/Client/HideClient.d.ts new file mode 100644 index 00000000000..aea15a42a5c --- /dev/null +++ b/src/hide/src/Client/HideClient.d.ts @@ -0,0 +1,12 @@ +import { Binder } from '@quenty/binder'; + +interface HideClient { + Destroy(): void; +} + +interface HideClientConstructor { + readonly ClassName: 'HideClient'; + new (adornee: Instance): HideClient; +} + +export const HideClient: Binder; diff --git a/src/hide/src/Client/HideServiceClient.d.ts b/src/hide/src/Client/HideServiceClient.d.ts new file mode 100644 index 00000000000..bb579f4a7fb --- /dev/null +++ b/src/hide/src/Client/HideServiceClient.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface HideServiceClient { + readonly ServiceName: 'HideServiceClient'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/hide/src/Server/Hide.d.ts b/src/hide/src/Server/Hide.d.ts new file mode 100644 index 00000000000..f091cd24f6a --- /dev/null +++ b/src/hide/src/Server/Hide.d.ts @@ -0,0 +1,12 @@ +import { Binder } from '@quenty/binder'; + +interface Hide { + Destroy(): void; +} + +interface HideConstructor { + readonly ClassName: 'Hide'; + new (adornee: Instance): Hide; +} + +export const Hide: Binder; diff --git a/src/hide/src/Server/HideService.d.ts b/src/hide/src/Server/HideService.d.ts new file mode 100644 index 00000000000..3d34c619ca2 --- /dev/null +++ b/src/hide/src/Server/HideService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface HideService { + readonly ServiceName: 'HideService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/hide/src/Shared/HideUtils.d.ts b/src/hide/src/Shared/HideUtils.d.ts new file mode 100644 index 00000000000..08c0d8cc249 --- /dev/null +++ b/src/hide/src/Shared/HideUtils.d.ts @@ -0,0 +1,3 @@ +export namespace HideUtils { + function isHidden(inst: Instance): boolean; +} diff --git a/src/highlight/index.d.ts b/src/highlight/index.d.ts new file mode 100644 index 00000000000..6bc0fae6e79 --- /dev/null +++ b/src/highlight/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/AnimatedHighlight'; +export * from './src/Client/AnimatedHighlightGroup'; +export * from './src/Client/HighlightServiceClient'; +export * from './src/Client/Stack/AnimatedHighlightModel'; +export * from './src/Client/Stack/AnimatedHighlightStack'; diff --git a/src/highlight/src/Client/AnimatedHighlight.d.ts b/src/highlight/src/Client/AnimatedHighlight.d.ts new file mode 100644 index 00000000000..eb9dc6a7756 --- /dev/null +++ b/src/highlight/src/Client/AnimatedHighlight.d.ts @@ -0,0 +1,30 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Signal } from '@quenty/signal'; + +interface AnimatedHighlight extends BasicPane { + Destroying: Signal; + SetHighlightDepthMode(depthMode: Enum.HighlightDepthMode): void; + SetPropertiesFrom(sourceHighlight: AnimatedHighlight): void; + SetTransparencySpeed(speed: number): void; + SetColorSpeed(speed: number): void; + SetSpeed(speed: number): void; + Finish(doNotAnimate: boolean, callback: () => void): void; + SetFillColor(color: Color3, doNotAnimate?: boolean): void; + SetOutlineColor(color: Color3, doNotAnimate?: boolean): void; + SetAdornee(adornee: Instance | undefined): void; + GetAdornee(): Instance | undefined; + SetOutlineTransparency( + outlineTransparency: number, + doNotAnimate?: boolean + ): void; + SetFillTransparency(fillTransparency: number, doNotAnimate?: boolean): void; +} + +interface AnimatedHighlightConstructor { + readonly ClassName: 'AnimatedHighlight'; + new (): AnimatedHighlight; + + isAnimatedHighlight: (value: unknown) => value is AnimatedHighlight; +} + +export const AnimatedHighlight: AnimatedHighlightConstructor; diff --git a/src/highlight/src/Client/AnimatedHighlightGroup.d.ts b/src/highlight/src/Client/AnimatedHighlightGroup.d.ts new file mode 100644 index 00000000000..32004128adf --- /dev/null +++ b/src/highlight/src/Client/AnimatedHighlightGroup.d.ts @@ -0,0 +1,31 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { AnimatedHighlightModel } from './Stack/AnimatedHighlightModel'; + +interface AnimatedHighlightGroup extends BaseObject { + SetDefaultHighlightDepthMode(depthMode: Enum.HighlightDepthMode): void; + SetDefaultFillTransparency(transparency: number): void; + SetDefaultOutlineTransparency(outlineTransparency: number): void; + SetDefaultFillColor(color: Color3): void; + GetDefaultFillColor(): Color3; + SetDefaultOutlineColor(color: Color3): void; + SetDefaultTransparencySpeed(speed: number): void; + SetDefaultSpeed(speed: number): void; + GetDefaultOutlineColor(): Color3; + Highlight( + adornee: Instance, + observeScore?: number | Observable + ): AnimatedHighlightModel; + HighlightWithTransferredProperties( + fromAdornee: Instance, + toAdornee: Instance, + observeScore?: number | Observable + ): AnimatedHighlightModel; +} + +interface AnimatedHighlightGroupConstructor { + readonly ClassName: 'AnimatedHighlightGroup'; + new (): AnimatedHighlightGroup; +} + +export const AnimatedHighlightGroup: AnimatedHighlightGroupConstructor; diff --git a/src/highlight/src/Client/HighlightServiceClient.d.ts b/src/highlight/src/Client/HighlightServiceClient.d.ts new file mode 100644 index 00000000000..42f0696ebe3 --- /dev/null +++ b/src/highlight/src/Client/HighlightServiceClient.d.ts @@ -0,0 +1,15 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { AnimatedHighlightGroup } from './AnimatedHighlightGroup'; +import { Observable } from '@quenty/rx'; +import { AnimatedHighlightModel } from './Stack/AnimatedHighlightModel'; + +export interface HighlightServiceClient { + readonly ServiceName: 'HighlightServiceClient'; + Init(serviceBag: ServiceBag): void; + GetAnimatedHighlightGroup(): AnimatedHighlightGroup; + Highlight( + adornee: Instance, + observeScore?: number | Observable + ): AnimatedHighlightModel; + Destroy(): void; +} diff --git a/src/highlight/src/Client/Stack/AnimatedHighlightModel.d.ts b/src/highlight/src/Client/Stack/AnimatedHighlightModel.d.ts new file mode 100644 index 00000000000..d429887ef2e --- /dev/null +++ b/src/highlight/src/Client/Stack/AnimatedHighlightModel.d.ts @@ -0,0 +1,42 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface AnimatedHighlightModel extends BaseObject { + HighlightDepthMode: ValueObject; + FillColor: ValueObject; + OutlineColor: ValueObject; + FillTransparency: ValueObject; + OutlineTransparency: ValueObject; + Speed: ValueObject; + ColorSpeed: ValueObject; + TransparencySpeed: ValueObject; + FillSpeed: ValueObject; + Destroying: Signal; + + SetHighlightDepthMode(depthMode: Enum.HighlightDepthMode | undefined): void; + SetTransparencySpeed(speed: number | undefined): void; + SetColorSpeed(speed: number | undefined): void; + SetSpeed(speed: number | undefined): void; + SetFillColor(color: Color3 | undefined, doNotAnimate?: boolean): void; + GetFillColor(): Color3 | undefined; + SetOutlineColor(color: Color3 | undefined, doNotAnimate?: boolean): void; + GetOutlineColor(): Color3 | undefined; + SetOutlineTransparency( + outlineTransparency: number | undefined, + doNotAnimate?: boolean + ): void; + SetFillTransparency( + fillTransparency: number | undefined, + doNotAnimate?: boolean + ): void; +} + +interface AnimatedHighlightModelConstructor { + readonly ClassName: 'AnimatedHighlightModel'; + new (): AnimatedHighlightModel; + + isAnimatedHighlightModel: (value: unknown) => value is AnimatedHighlightModel; +} + +export const AnimatedHighlightModel: AnimatedHighlightModelConstructor; diff --git a/src/highlight/src/Client/Stack/AnimatedHighlightStack.d.ts b/src/highlight/src/Client/Stack/AnimatedHighlightStack.d.ts new file mode 100644 index 00000000000..c7e5b874702 --- /dev/null +++ b/src/highlight/src/Client/Stack/AnimatedHighlightStack.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { AnimatedHighlightModel } from './AnimatedHighlightModel'; + +interface AnimatedHighlightStack extends BaseObject { + Done: Signal; + Destroying: Signal; + + SetPropertiesFrom(source: AnimatedHighlightStack): void; + ObserveHasEntries(): Observable; + GetHandle(observeScore: Observable): AnimatedHighlightModel; +} + +interface AnimatedHighlightStackConstructor { + readonly ClassName: 'AnimatedHighlightStack'; + new (): AnimatedHighlightStack; + + isAnimatedHighlightStack: (value: unknown) => value is AnimatedHighlightStack; +} + +export const AnimatedHighlightStack: AnimatedHighlightStackConstructor; diff --git a/src/hintscoringutils/index.d.ts b/src/hintscoringutils/index.d.ts new file mode 100644 index 00000000000..fdc1eb3a3ad --- /dev/null +++ b/src/hintscoringutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/HintScoringUtils'; diff --git a/src/hintscoringutils/src/Client/HintScoringUtils.d.ts b/src/hintscoringutils/src/Client/HintScoringUtils.d.ts new file mode 100644 index 00000000000..3c70e1a2445 --- /dev/null +++ b/src/hintscoringutils/src/Client/HintScoringUtils.d.ts @@ -0,0 +1,48 @@ +import { Raycaster } from '@quenty/raycaster'; + +export namespace HintScoringUtils { + function getHumanoidPositionDirection( + humanoid: Humanoid + ): LuaTuple<[position: Vector3, lookVector: Vector3]>; + function getAdorneeInRegionSet( + position: Vector3, + radius: number, + ignoreList: Instance[], + getAdorneeFunction: (instance: Instance) => Instance | undefined + ): Map; + function debugScore(adornee: Instance, score: number): void; + function raycastToAdornee( + raycaster: Raycaster, + humanoidCenter: Vector3, + adornee: Instance, + closestBoundingBoxPoint: Vector3, + extraDistance: number + ): Vector3 | undefined; + function clampToBoundingBox( + adornee: Instance, + humanoidCenter: Vector3 + ): LuaTuple< + [clampedPoint: Vector3 | undefined, centerPoint: Vector3 | undefined] + >; + function scoreAdornee( + adornee: Instance, + raycaster: Raycaster, + humanoidCenter: Vector3, + humanoidLookVector: Vector3, + maxViewRadius: number, + maxTriggerRadius: number, + maxViewAngle: number, + maxTriggerAngle: number, + isLineOfSightRequired: boolean + ): number | undefined; + function scoreDist( + distance: number, + maxViewDistance: number, + maxTriggerRadius: number + ): number | undefined; + function scoreAngle( + angle: number, + maxViewAngle: number, + maxTriggerAngle: number + ): number | undefined; +} diff --git a/src/httppromise/index.d.ts b/src/httppromise/index.d.ts new file mode 100644 index 00000000000..8717c01c09f --- /dev/null +++ b/src/httppromise/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/HttpPromise'; diff --git a/src/httppromise/src/Server/HttpPromise.d.ts b/src/httppromise/src/Server/HttpPromise.d.ts new file mode 100644 index 00000000000..059f2675738 --- /dev/null +++ b/src/httppromise/src/Server/HttpPromise.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; + +export namespace HttpPromise { + function request(request: Request): Promise; + function isHttpResponse(value: unknown): value is RequestAsyncResponse; + function convertHttpResponseToString(value: RequestAsyncResponse): string; + function json(request: RequestAsyncResponse | string): Promise; + function logFailedRequests(requests: (string | RequestAsyncResponse)[]): void; + function decodeJSON(response: RequestAsyncResponse): unknown; +} diff --git a/src/humanoidanimatorutils/index.d.ts b/src/humanoidanimatorutils/index.d.ts new file mode 100644 index 00000000000..f2819c4cf40 --- /dev/null +++ b/src/humanoidanimatorutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/HumanoidAnimatorUtils'; diff --git a/src/humanoidanimatorutils/src/Shared/HumanoidAnimatorUtils.d.ts b/src/humanoidanimatorutils/src/Shared/HumanoidAnimatorUtils.d.ts new file mode 100644 index 00000000000..1ebd85ae9f8 --- /dev/null +++ b/src/humanoidanimatorutils/src/Shared/HumanoidAnimatorUtils.d.ts @@ -0,0 +1,11 @@ +export namespace HumanoidAnimatorUtils { + function getOrCreateAnimator( + humanoid: Humanoid | AnimationController + ): Animator; + function findAnimator(target: Instance): Animator | undefined; + function stopAnimations(humanoid: Humanoid, fadeTime: number): void; + function isPlayingAnimationTrack( + humanoid: Humanoid, + track: AnimationTrack + ): boolean; +} diff --git a/src/humanoiddescriptionutils/index.d.ts b/src/humanoiddescriptionutils/index.d.ts new file mode 100644 index 00000000000..800ee3cf4a7 --- /dev/null +++ b/src/humanoiddescriptionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/HumanoidDescriptionUtils'; diff --git a/src/humanoiddescriptionutils/src/Shared/HumanoidDescriptionUtils.d.ts b/src/humanoiddescriptionutils/src/Shared/HumanoidDescriptionUtils.d.ts new file mode 100644 index 00000000000..499d8114ca5 --- /dev/null +++ b/src/humanoiddescriptionutils/src/Shared/HumanoidDescriptionUtils.d.ts @@ -0,0 +1,21 @@ +import { Promise } from '@quenty/promise'; + +export namespace HumanoidDescriptionUtils { + function promiseApplyDescription( + humanoid: Humanoid, + description: HumanoidDescription + ): Promise; + function promiseApplyDescriptionReset( + humanoid: Humanoid, + description: HumanoidDescription, + assetTypeVerification?: Enum.AssetTypeVerification + ): Promise; + function promiseApplyFromUserName( + humanoid: Humanoid, + userName: string + ): Promise; + function promiseFromUserName(userName: string): Promise; + function promiseFromUserId(userId: number): Promise; + function getAssetIdsFromString(assetString: string): number[]; + function getAssetPromisesFromString(assetString: string): Promise[]; +} diff --git a/src/humanoidkillerutils/index.d.ts b/src/humanoidkillerutils/index.d.ts new file mode 100644 index 00000000000..bf8aa91b9c0 --- /dev/null +++ b/src/humanoidkillerutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/HumanoidKillerUtils'; diff --git a/src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.d.ts b/src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.d.ts new file mode 100644 index 00000000000..91882e721df --- /dev/null +++ b/src/humanoidkillerutils/src/Shared/HumanoidKillerUtils.d.ts @@ -0,0 +1,8 @@ +export namespace HumanoidKillerUtils { + function untagKiller(humanoid: Humanoid): void; + function tagKiller(humanoid: Humanoid, attacker: Player): ObjectValue; + function getKillerHumanoidOfHumanoid( + humanoid: Humanoid + ): Humanoid | undefined; + function getPlayerKillerOfHumanoid(humanoid: Humanoid): Player | undefined; +} diff --git a/src/humanoidmovedirectionutils/index.d.ts b/src/humanoidmovedirectionutils/index.d.ts new file mode 100644 index 00000000000..bd68f6156a2 --- /dev/null +++ b/src/humanoidmovedirectionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/HumanoidMoveDirectionUtils'; diff --git a/src/humanoidmovedirectionutils/src/Client/HumanoidMoveDirectionUtils.d.ts b/src/humanoidmovedirectionutils/src/Client/HumanoidMoveDirectionUtils.d.ts new file mode 100644 index 00000000000..75397271763 --- /dev/null +++ b/src/humanoidmovedirectionutils/src/Client/HumanoidMoveDirectionUtils.d.ts @@ -0,0 +1,6 @@ +export namespace HumanoidMoveDirectionUtils { + function getRelativeMoveDirection( + cameraCFrame: CFrame, + humanoid: Humanoid + ): Vector3; +} diff --git a/src/humanoidspeed/index.d.ts b/src/humanoidspeed/index.d.ts new file mode 100644 index 00000000000..30318349a80 --- /dev/null +++ b/src/humanoidspeed/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/HumanoidSpeedBindersClient'; +export * from './src/Client/HumanoidSpeedClient'; +export * from './src/Server/HumanoidSpeed'; +export * from './src/Server/HumanoidSpeedBindersServer'; diff --git a/src/humanoidspeed/src/Client/HumanoidSpeedBindersClient.d.ts b/src/humanoidspeed/src/Client/HumanoidSpeedBindersClient.d.ts new file mode 100644 index 00000000000..964a583c212 --- /dev/null +++ b/src/humanoidspeed/src/Client/HumanoidSpeedBindersClient.d.ts @@ -0,0 +1,6 @@ +import { BinderProvider } from '@quenty/binder'; +import { HumanoidSpeedClient } from './HumanoidSpeedClient'; + +export const HumanoidSpeedBindersClient: BinderProvider<{ + HumanoidSpeed: HumanoidSpeedClient; +}>; diff --git a/src/humanoidspeed/src/Client/HumanoidSpeedClient.d.ts b/src/humanoidspeed/src/Client/HumanoidSpeedClient.d.ts new file mode 100644 index 00000000000..bb5f534b4db --- /dev/null +++ b/src/humanoidspeed/src/Client/HumanoidSpeedClient.d.ts @@ -0,0 +1,13 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; + +interface HumanoidSpeedClient extends BaseObject { + GetPlayer(): Player | undefined; +} + +interface HumanoidSpeedClientConstructor { + readonly ClassName: 'HumanoidSpeedClient'; + new (humanoid: Humanoid): HumanoidSpeedClient; +} + +export const HumanoidSpeedClient: Binder; diff --git a/src/humanoidspeed/src/Server/HumanoidSpeed.d.ts b/src/humanoidspeed/src/Server/HumanoidSpeed.d.ts new file mode 100644 index 00000000000..20492dd2b82 --- /dev/null +++ b/src/humanoidspeed/src/Server/HumanoidSpeed.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { ServiceBag } from '@quenty/servicebag'; + +interface HumanoidSpeed extends BaseObject { + SetDefaultSpeed(defaultSpeed: number): void; + ApplySpeedMultiplier(multiplier: number): () => void; + ApplySpeedAdditive(amount: number): () => void; +} + +interface HumanoidSpeedConstructor { + readonly ClassName: 'HumanoidSpeed'; + new (humanoid: Humanoid, serviceBag: ServiceBag): HumanoidSpeed; +} + +export const HumanoidSpeed: PlayerHumanoidBinder; diff --git a/src/humanoidspeed/src/Server/HumanoidSpeedBindersServer.d.ts b/src/humanoidspeed/src/Server/HumanoidSpeedBindersServer.d.ts new file mode 100644 index 00000000000..e3062562483 --- /dev/null +++ b/src/humanoidspeed/src/Server/HumanoidSpeedBindersServer.d.ts @@ -0,0 +1,6 @@ +import { BinderProvider } from '@quenty/binder'; +import { HumanoidSpeed } from './HumanoidSpeed'; + +export const HumanoidSpeedBindersServer: BinderProvider<{ + HumanoidSpeed: HumanoidSpeed; +}>; diff --git a/src/humanoidteleportutils/index.d.ts b/src/humanoidteleportutils/index.d.ts new file mode 100644 index 00000000000..7be36d62865 --- /dev/null +++ b/src/humanoidteleportutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/HumanoidTeleportUtils'; diff --git a/src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.d.ts b/src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.d.ts new file mode 100644 index 00000000000..490a2178a7a --- /dev/null +++ b/src/humanoidteleportutils/src/Shared/HumanoidTeleportUtils.d.ts @@ -0,0 +1,23 @@ +import { Raycaster } from '@quenty/raycaster'; + +export namespace HumanoidTeleportUtils { + function identifySafePosition( + position: Vector3, + raycaster: Raycaster + ): LuaTuple< + [success: true, position: Vector3] | [success: false, position: undefined] + >; + function teleportRootPart( + humanoid: Humanoid, + rootPart: BasePart, + position: Vector3 + ): void; + function teleportParts( + humanoid: Humanoid, + rootPart: BasePart, + parts: BasePart[], + position: Vector3 + ): void; + function tryTeleportCharacter(character: Model, position: Vector3): boolean; + function getRootPartOffset(humanoid: Humanoid, rootPart: BasePart): Vector3; +} diff --git a/src/humanoidtracker/index.d.ts b/src/humanoidtracker/index.d.ts new file mode 100644 index 00000000000..6981c64856c --- /dev/null +++ b/src/humanoidtracker/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/HumanoidTracker'; +export * from './src/Shared/HumanoidTrackerService'; diff --git a/src/humanoidtracker/src/Shared/HumanoidTracker.d.ts b/src/humanoidtracker/src/Shared/HumanoidTracker.d.ts new file mode 100644 index 00000000000..974400c85f2 --- /dev/null +++ b/src/humanoidtracker/src/Shared/HumanoidTracker.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Signal } from '@quenty/signal'; +import { ValueObject } from '@quenty/valueobject'; + +interface HumanoidTracker extends BaseObject { + HumanoidDied: Signal; + Humanoid: ValueObject; + AliveHumanoid: ValueObject; + PromiseNextHumanoid(): Promise; +} + +interface HumanoidTrackerConstructor { + readonly ClassName: 'HumanoidTracker'; + new (player: Player): HumanoidTracker; +} + +export const HumanoidTracker: HumanoidTrackerConstructor; diff --git a/src/humanoidtracker/src/Shared/HumanoidTrackerService.d.ts b/src/humanoidtracker/src/Shared/HumanoidTrackerService.d.ts new file mode 100644 index 00000000000..1570dfbbf6a --- /dev/null +++ b/src/humanoidtracker/src/Shared/HumanoidTrackerService.d.ts @@ -0,0 +1,16 @@ +import { Observable } from '@quenty/rx'; +import { HumanoidTracker } from './HumanoidTracker'; +import { Brio } from '@quenty/brio'; + +export interface HumanoidTrackerService { + readonly ServiceName: 'HumanoidTrackerService'; + Init(): void; + GetHumanoidTracker(player?: Player): HumanoidTracker | undefined; + GetHumanoid(player?: Player): Humanoid | undefined; + ObserveHumanoid(player?: Player): Observable; + ObserveHumanoidBrio(player?: Player): Observable>; + GetAliveHumanoid(player?: Player): Humanoid | undefined; + ObserveAliveHumanoid(player?: Player): Observable; + ObserveAliveHumanoidBrio(player?: Player): Observable>; + Destroy(): void; +} diff --git a/src/humanoidutils/index.d.ts b/src/humanoidutils/index.d.ts new file mode 100644 index 00000000000..e65b88bbef9 --- /dev/null +++ b/src/humanoidutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/HumanoidUtils'; diff --git a/src/humanoidutils/src/Shared/HumanoidUtils.d.ts b/src/humanoidutils/src/Shared/HumanoidUtils.d.ts new file mode 100644 index 00000000000..0434b9e4bcb --- /dev/null +++ b/src/humanoidutils/src/Shared/HumanoidUtils.d.ts @@ -0,0 +1,4 @@ +export namespace HumanoidUtils { + function getHumanoid(descendant: Instance): Humanoid | undefined; + function forceUnseatHumanoid(humanoid: Humanoid): void; +} diff --git a/src/idleservice/index.d.ts b/src/idleservice/index.d.ts new file mode 100644 index 00000000000..fa7f5c43035 --- /dev/null +++ b/src/idleservice/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Client/IdleServiceClient'; +export * from './src/Client/IdleTargetCalculator'; +export * from './src/Server/IdleService'; diff --git a/src/idleservice/src/Client/IdleServiceClient.d.ts b/src/idleservice/src/Client/IdleServiceClient.d.ts new file mode 100644 index 00000000000..721351c8e3c --- /dev/null +++ b/src/idleservice/src/Client/IdleServiceClient.d.ts @@ -0,0 +1,19 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface IdleServiceClient { + readonly ServiceName: 'IdleServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + ObserveHumanoidMoveFromCurrentPosition( + minimumTimeVisible: number + ): Observable; + IsHumanoidIdle(): boolean; + IsMoving(): boolean; + ObserveHumanoidIdle(): Observable; + DoShowIdleUI(): boolean; + ObserveShowIdleUI(): Observable; + GetShowIdleUIBoolValue(): BoolValue; + PushDisable(): () => void; + Destroy(): void; +} diff --git a/src/idleservice/src/Client/IdleTargetCalculator.d.ts b/src/idleservice/src/Client/IdleTargetCalculator.d.ts new file mode 100644 index 00000000000..a1b5755be53 --- /dev/null +++ b/src/idleservice/src/Client/IdleTargetCalculator.d.ts @@ -0,0 +1,17 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface IdleTargetCalculator extends BaseObject { + Changed: Signal; + GetShouldDisableContextUI(): boolean; + ObserveShouldDisableContextUI(): Observable; + SetTarget(targetPosition: Vector3): void; +} + +interface IdleTargetCalculatorConstructor { + readonly ClassName: 'IdleTargetCalculator'; + new (): IdleTargetCalculator; +} + +export const IdleTargetCalculator: IdleTargetCalculatorConstructor; diff --git a/src/idleservice/src/Server/IdleService.d.ts b/src/idleservice/src/Server/IdleService.d.ts new file mode 100644 index 00000000000..bbcc02c04f0 --- /dev/null +++ b/src/idleservice/src/Server/IdleService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface IdleService { + readonly ServiceName: 'IdleService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/ik/index.d.ts b/src/ik/index.d.ts new file mode 100644 index 00000000000..a11c70a56ba --- /dev/null +++ b/src/ik/index.d.ts @@ -0,0 +1,22 @@ +export * from './src/Client/GripPointer'; +export * from './src/Client/IKServiceClient'; +export * from './src/Client/Rig/IKRigAimerLocalPlayer'; +export * from './src/Client/Rig/IKRigClient'; +export * from './src/Server/IKService'; +export * from './src/Server/Rig/IKRig'; +export * from './src/Shared/Arm/ArmIKBase'; +export * from './src/Shared/Arm/ArmIKUtils'; +export * from './src/Shared/Arm/IKAimPositionPriorites'; +export * from './src/Shared/Grip/IKGripBase'; +export * from './src/Shared/Grip/IKGripUtils'; +export * from './src/Shared/Grip/IKLeftGrip'; +export * from './src/Shared/Grip/IKRightGrip'; +export * from './src/Shared/IKDataService'; +export * from './src/Shared/IKUtils'; +export * from './src/Shared/Interfaces/IKRigInterface'; +export * from './src/Shared/Resources/IKResource'; +export * from './src/Shared/Resources/IKResourceUtils'; +export * from './src/Shared/Rig/IKRigBase'; +export * from './src/Shared/Rig/IKRigUtils'; +export * from './src/Shared/Torso/TorsoIKBase'; +export * from './src/Shared/Torso/TorsoIKUtils'; diff --git a/src/ik/src/Client/GripPointer.d.ts b/src/ik/src/Client/GripPointer.d.ts new file mode 100644 index 00000000000..112aec2e17d --- /dev/null +++ b/src/ik/src/Client/GripPointer.d.ts @@ -0,0 +1,14 @@ +import { BaseObject } from '@quenty/baseobject'; +import { IKRigClient } from './Rig/IKRigClient'; + +interface GripPointer extends BaseObject { + SetLeftGrip(leftGrip: Attachment): void; + SetRightGrip(rightGrip: Attachment): void; +} + +interface GripPointerConstructor { + readonly ClassName: 'GripPointer'; + new (ikRig: IKRigClient): GripPointer; +} + +export const GripPointer: GripPointerConstructor; diff --git a/src/ik/src/Client/IKServiceClient.d.ts b/src/ik/src/Client/IKServiceClient.d.ts new file mode 100644 index 00000000000..6a5e20c559d --- /dev/null +++ b/src/ik/src/Client/IKServiceClient.d.ts @@ -0,0 +1,17 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { IKRigClient } from './Rig/IKRigClient'; +import { Promise } from '@quenty/promise'; +import { IKRigAimerLocalPlayer } from './Rig/IKRigAimerLocalPlayer'; + +export interface IKServiceClient { + readonly ServiceName: 'IKServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetRig(humanoid: Humanoid): IKRigClient | undefined; + PromiseRig(humanoid: Humanoid): Promise; + SetAimPosition(position: Vector3 | undefined, priority?: number): void; + SetLookAround(lookAround: boolean): void; + GetLocalAimer(): IKRigAimerLocalPlayer | undefined; + GetLocalPlayerRig(): IKRigClient | undefined; + Destroy(): void; +} diff --git a/src/ik/src/Client/Rig/IKRigAimerLocalPlayer.d.ts b/src/ik/src/Client/Rig/IKRigAimerLocalPlayer.d.ts new file mode 100644 index 00000000000..72b05d55f92 --- /dev/null +++ b/src/ik/src/Client/Rig/IKRigAimerLocalPlayer.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface IKRigAimerLocalPlayer extends BaseObject { + SetLookAround(lookAround: boolean): void; + SetAimPosition( + position: Vector3 | undefined, + optionalPriority?: number + ): void; + PushReplicationRate(replicateRate: number): () => void; + GetAimPosition(): Vector3 | undefined; + UpdateStepped(): void; +} + +interface IKRigAimerLocalPlayerConstructor { + readonly ClassName: 'IKRigAimerLocalPlayer'; + new (): IKRigAimerLocalPlayer; +} + +export const IKRigAimerLocalPlayer: IKRigAimerLocalPlayerConstructor; diff --git a/src/ik/src/Client/Rig/IKRigClient.d.ts b/src/ik/src/Client/Rig/IKRigClient.d.ts new file mode 100644 index 00000000000..aa8e741babd --- /dev/null +++ b/src/ik/src/Client/Rig/IKRigClient.d.ts @@ -0,0 +1,16 @@ +import { Binder } from '@quenty/binder'; +import { IKRigBase } from '../../Shared/Rig/IKRigBase'; +import { IKRigAimerLocalPlayer } from './IKRigAimerLocalPlayer'; + +interface IKRigClient extends IKRigBase { + GetPositionOrNil(): Vector3 | undefined; + GetLocalPlayerAimer(): IKRigAimerLocalPlayer | undefined; + GetAimPosition(): Vector3 | undefined; +} + +interface IKRigClientConstructor { + readonly ClassName: 'IKRigClient'; + new (): IKRigClient; +} + +export const IKRigClient: Binder; diff --git a/src/ik/src/Server/IKService.d.ts b/src/ik/src/Server/IKService.d.ts new file mode 100644 index 00000000000..396a3138cb9 --- /dev/null +++ b/src/ik/src/Server/IKService.d.ts @@ -0,0 +1,14 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { IKRig } from './Rig/IKRig'; +import { Promise } from '@quenty/promise'; + +export interface IKService { + readonly ServiceName: 'IKService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetRig(humanoid: Humanoid): IKRig | undefined; + PromiseRig(humanoid: Humanoid): Promise; + RemoveRig(humanoid: Humanoid): void; + UpdateServerRigTarget(humanoid: Humanoid, target: Vector3): void; + Destroy(): void; +} diff --git a/src/ik/src/Server/Rig/IKRig.d.ts b/src/ik/src/Server/Rig/IKRig.d.ts new file mode 100644 index 00000000000..7ae240d5bc3 --- /dev/null +++ b/src/ik/src/Server/Rig/IKRig.d.ts @@ -0,0 +1,15 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { IKRigBase } from '../../Shared/Rig/IKRigBase'; +import { Binder } from '@quenty/binder'; + +interface IKRig extends IKRigBase { + GetAimPosition(): Vector3 | undefined; + SetAimPosition(position: Vector3 | undefined): void; +} + +interface IKRigConstructor { + readonly ClassName: 'IKRig'; + new (humanoid: Humanoid, serviceBag: ServiceBag): IKRig; +} + +export const IKRig: Binder; diff --git a/src/ik/src/Shared/Arm/ArmIKBase.d.ts b/src/ik/src/Shared/Arm/ArmIKBase.d.ts new file mode 100644 index 00000000000..546cc2c99c1 --- /dev/null +++ b/src/ik/src/Shared/Arm/ArmIKBase.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface ArmIKBase extends BaseObject { + Grip(attachment: Attachment, priority?: number): void; + UpdateTransformOnly(): void; + Update(): void; +} + +interface ArmIKBaseConstructor { + readonly ClassName: 'ArmIKBase'; + new (humanoid: Humanoid, armName: string, serviceBag: ServiceBag): ArmIKBase; +} + +export const ArmIKBase: ArmIKBaseConstructor; diff --git a/src/ik/src/Shared/Arm/ArmIKUtils.d.ts b/src/ik/src/Shared/Arm/ArmIKUtils.d.ts new file mode 100644 index 00000000000..0eea0ccbc1c --- /dev/null +++ b/src/ik/src/Shared/Arm/ArmIKUtils.d.ts @@ -0,0 +1,5 @@ +import { Maid } from '@quenty/maid'; + +export namespace ArmIKUtils { + function ensureMotorAnimated(character: Model, armName: string): Maid; +} diff --git a/src/ik/src/Shared/Arm/IKAimPositionPriorites.d.ts b/src/ik/src/Shared/Arm/IKAimPositionPriorites.d.ts new file mode 100644 index 00000000000..3be12aa0ad3 --- /dev/null +++ b/src/ik/src/Shared/Arm/IKAimPositionPriorites.d.ts @@ -0,0 +1,6 @@ +export const IKAimPositionPriorites: Readonly<{ + DEFAULT: 0; + LOW: 1000; + MEDIUM: 3000; + HIGH: 4000; +}>; diff --git a/src/ik/src/Shared/Grip/IKGripBase.d.ts b/src/ik/src/Shared/Grip/IKGripBase.d.ts new file mode 100644 index 00000000000..93cb142d05f --- /dev/null +++ b/src/ik/src/Shared/Grip/IKGripBase.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { IKRigBase } from '../Rig/IKRigBase'; + +interface IKGripBase extends BaseObject { + GetPriority(): number; + GetAttachment(): Attachment | undefined; + PromiseIKRig(): Promise; +} + +interface IKGripBaseConstructor { + readonly ClassName: 'IKGripBase'; + new (objectValue: ObjectValue, serviceBag: ServiceBag): IKGripBase; +} + +export const IKGripBase: IKGripBaseConstructor; diff --git a/src/ik/src/Shared/Grip/IKGripUtils.d.ts b/src/ik/src/Shared/Grip/IKGripUtils.d.ts new file mode 100644 index 00000000000..7a85d594ec8 --- /dev/null +++ b/src/ik/src/Shared/Grip/IKGripUtils.d.ts @@ -0,0 +1,6 @@ +import { Binder } from '@quenty/binder'; +import { IKGripBase } from './IKGripBase'; + +export namespace IKGripUtils { + function create(binder: Binder, humanoid: Humanoid): ObjectValue; +} diff --git a/src/ik/src/Shared/Grip/IKLeftGrip.d.ts b/src/ik/src/Shared/Grip/IKLeftGrip.d.ts new file mode 100644 index 00000000000..830c3edac81 --- /dev/null +++ b/src/ik/src/Shared/Grip/IKLeftGrip.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { IKGripBase } from './IKGripBase'; +import { Binder } from '@quenty/binder'; + +interface IKLeftGrip extends IKGripBase {} + +interface IKLeftGripConstructor { + readonly ClassName: 'IKLeftGrip'; + new (objectValue: ObjectValue, serviceBag: ServiceBag): IKLeftGrip; +} + +export const IKLeftGrip: Binder; diff --git a/src/ik/src/Shared/Grip/IKRightGrip.d.ts b/src/ik/src/Shared/Grip/IKRightGrip.d.ts new file mode 100644 index 00000000000..30d602fd586 --- /dev/null +++ b/src/ik/src/Shared/Grip/IKRightGrip.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { IKGripBase } from './IKGripBase'; +import { Binder } from '@quenty/binder'; + +interface IKRightGrip extends IKGripBase {} + +interface IKRightGripConstructor { + readonly ClassName: 'IKRightGrip'; + new (objectValue: ObjectValue, serviceBag: ServiceBag): IKRightGrip; +} + +export const IKRightGrip: Binder; diff --git a/src/ik/src/Shared/IKDataService.d.ts b/src/ik/src/Shared/IKDataService.d.ts new file mode 100644 index 00000000000..3fd8860cd71 --- /dev/null +++ b/src/ik/src/Shared/IKDataService.d.ts @@ -0,0 +1,13 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { IKRigBase } from './Rig/IKRigBase'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export interface IKDataService { + readonly ServiceName: 'IKDataService'; + Init(serviceBag: ServiceBag): void; + PromiseRig(humanoid: Humanoid): Promise; + ObserveRig(humanoid: Humanoid): Observable; + ObserveRigBrio(humanoid: Humanoid): Observable>; +} diff --git a/src/ik/src/Shared/IKUtils.d.ts b/src/ik/src/Shared/IKUtils.d.ts new file mode 100644 index 00000000000..b1847fbb0e5 --- /dev/null +++ b/src/ik/src/Shared/IKUtils.d.ts @@ -0,0 +1,7 @@ +export namespace IKUtils { + function getDampenedAngleClamp( + maxAngle: number, + dampenAreaAngle: number, + dampenAreaFactor?: number + ): (angle: number) => number; +} diff --git a/src/ik/src/Shared/Interfaces/IKRigInterface.d.ts b/src/ik/src/Shared/Interfaces/IKRigInterface.d.ts new file mode 100644 index 00000000000..77c65fa958f --- /dev/null +++ b/src/ik/src/Shared/Interfaces/IKRigInterface.d.ts @@ -0,0 +1,13 @@ +import { TieDefinition, TieDefinitionMethod } from '@quenty/tie'; + +export const IKRigInterface: TieDefinition<{ + GetPlayer: TieDefinitionMethod; + GetHumanoid: TieDefinitionMethod; + + PromiseLeftArm: TieDefinitionMethod; + PromiseRightArm: TieDefinitionMethod; + GetLeftArm: TieDefinitionMethod; + GetRightArm: TieDefinitionMethod; + + GetAimPosition: TieDefinitionMethod; +}>; diff --git a/src/ik/src/Shared/Resources/IKResource.d.ts b/src/ik/src/Shared/Resources/IKResource.d.ts new file mode 100644 index 00000000000..26ad48b7843 --- /dev/null +++ b/src/ik/src/Shared/Resources/IKResource.d.ts @@ -0,0 +1,24 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; + +export interface IKResourceData { + name: string; + robloxName: string; +} + +interface IKResource extends BaseObject { + ReadyChanged: Signal; + GetData(): IKResourceData; + IsReady(): boolean; + Get(descendantName: string): Instance; + GetInstance(): Instance | undefined; + SetInstance(instance: Instance | undefined): void; + GetLookupTable(): Readonly>; +} + +interface IKResourceConstructor { + readonly ClassName: 'IKResource'; + new (data: IKResourceData): IKResource; +} + +export const IKResource: IKResourceConstructor; diff --git a/src/ik/src/Shared/Resources/IKResourceUtils.d.ts b/src/ik/src/Shared/Resources/IKResourceUtils.d.ts new file mode 100644 index 00000000000..25eece22248 --- /dev/null +++ b/src/ik/src/Shared/Resources/IKResourceUtils.d.ts @@ -0,0 +1,5 @@ +import { IKResourceData } from './IKResource'; + +export namespace IKResourceUtils { + function createResource(data: IKResourceData): IKResourceData; +} diff --git a/src/ik/src/Shared/Rig/IKRigBase.d.ts b/src/ik/src/Shared/Rig/IKRigBase.d.ts new file mode 100644 index 00000000000..172fa5cf084 --- /dev/null +++ b/src/ik/src/Shared/Rig/IKRigBase.d.ts @@ -0,0 +1,28 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { Signal } from '@quenty/signal'; +import { TorsoIKBase } from '../Torso/TorsoIKBase'; +import { ArmIKBase } from '../Arm/ArmIKBase'; + +interface IKRigBase extends BaseObject { + Updating: Signal; + GetLastUpdateTime(): number; + GetPlayer(): Player | undefined; + GetHumanoid(): Humanoid; + Update(): void; + UpdateTransformOnly(): void; + PromiseTorso(): Promise; + GetTorso(): TorsoIKBase; + PromiseLeftArm(): Promise; + GetLeftArm(): ArmIKBase; + PromiseRightArm(): Promise; + GetRightArm(): ArmIKBase; +} + +interface IKRigBaseConstructor { + readonly ClassName: 'IKRigBase'; + new (humanoid: Humanoid, serviceBag: ServiceBag): IKRigBase; +} + +export const IKRigBase: IKRigBaseConstructor; diff --git a/src/ik/src/Shared/Rig/IKRigUtils.d.ts b/src/ik/src/Shared/Rig/IKRigUtils.d.ts new file mode 100644 index 00000000000..e7a6c7990c2 --- /dev/null +++ b/src/ik/src/Shared/Rig/IKRigUtils.d.ts @@ -0,0 +1,6 @@ +import { Binder } from '@quenty/binder'; + +export namespace IKRigUtils { + function getTimeBeforeNextUpdate(distance: number): number; + function getPlayerIKRig(binder: Binder, player: Player): T | undefined; +} diff --git a/src/ik/src/Shared/Torso/TorsoIKBase.d.ts b/src/ik/src/Shared/Torso/TorsoIKBase.d.ts new file mode 100644 index 00000000000..8235de9cdf6 --- /dev/null +++ b/src/ik/src/Shared/Torso/TorsoIKBase.d.ts @@ -0,0 +1,8 @@ +interface TorsoIKBase {} + +interface TorsoIKBaseConstructor { + readonly ClassName: 'TorsoIKBase'; + new (): TorsoIKBase; +} + +export const TorsoIKBase: TorsoIKBaseConstructor; diff --git a/src/ik/src/Shared/Torso/TorsoIKUtils.d.ts b/src/ik/src/Shared/Torso/TorsoIKUtils.d.ts new file mode 100644 index 00000000000..8e3801196fb --- /dev/null +++ b/src/ik/src/Shared/Torso/TorsoIKUtils.d.ts @@ -0,0 +1,6 @@ +export namespace TorsoIKUtils { + function getTargetAngles( + rootPart: BasePart, + target: Vector3 + ): LuaTuple<[waistY: number, headY: number, waistZ: number, headZ: number]>; +} diff --git a/src/influxdbclient/index.d.ts b/src/influxdbclient/index.d.ts new file mode 100644 index 00000000000..25e1dcb6497 --- /dev/null +++ b/src/influxdbclient/index.d.ts @@ -0,0 +1,9 @@ +export * from './src/Server/Config/InfluxDBClientConfigUtils'; +export * from './src/Server/Config/InfluxDBWriteOptionUtils'; +export * from './src/Server/InfluxDBClient'; +export * from './src/Server/Utils/InfluxDBErrorUtils'; +export * from './src/Server/Write/InfluxDBWriteAPI'; +export * from './src/Server/Write/InfluxDBWriteBuffer'; +export * from './src/Shared/Config/InfluxDBPointSettings'; +export * from './src/Shared/Utils/InfluxDBEscapeUtils'; +export * from './src/Shared/Write/InfluxDBPoint'; diff --git a/src/influxdbclient/src/Server/Config/InfluxDBClientConfigUtils.d.ts b/src/influxdbclient/src/Server/Config/InfluxDBClientConfigUtils.d.ts new file mode 100644 index 00000000000..5b0e2f5b931 --- /dev/null +++ b/src/influxdbclient/src/Server/Config/InfluxDBClientConfigUtils.d.ts @@ -0,0 +1,11 @@ +export interface InfluxDBClientConfig { + url: string; + token: string | Secret; +} + +export namespace InfluxDBClientConfigUtils { + function isClientConfig(value: unknown): value is InfluxDBClientConfig; + function createClientConfig( + config: InfluxDBClientConfig + ): InfluxDBClientConfig; +} diff --git a/src/influxdbclient/src/Server/Config/InfluxDBWriteOptionUtils.d.ts b/src/influxdbclient/src/Server/Config/InfluxDBWriteOptionUtils.d.ts new file mode 100644 index 00000000000..15613167161 --- /dev/null +++ b/src/influxdbclient/src/Server/Config/InfluxDBWriteOptionUtils.d.ts @@ -0,0 +1,13 @@ +export interface InfluxDBWriteOptions { + batchSize: number; + maxBatchBytes: number; + flushIntervalSeconds: number; +} + +export namespace InfluxDBWriteOptionUtils { + function getDefaultOptions(): InfluxDBWriteOptions; + function createWriteOptions( + options: InfluxDBWriteOptions + ): Readonly; + function isWriteOptions(value: unknown): value is InfluxDBWriteOptions; +} diff --git a/src/influxdbclient/src/Server/InfluxDBClient.d.ts b/src/influxdbclient/src/Server/InfluxDBClient.d.ts new file mode 100644 index 00000000000..5f5d003bf20 --- /dev/null +++ b/src/influxdbclient/src/Server/InfluxDBClient.d.ts @@ -0,0 +1,21 @@ +import { BaseObject } from '@quenty/baseobject'; +import { InfluxDBClientConfig } from './Config/InfluxDBClientConfigUtils'; +import { InfluxDBWriteAPI } from './Write/InfluxDBWriteAPI'; +import { Promise } from '@quenty/promise'; + +interface InfluxDBClient extends BaseObject { + SetClientConfig(clientConfig: InfluxDBClientConfig): void; + GetWriteAPI( + org: string, + bucket: string, + precision?: string + ): InfluxDBWriteAPI; + PromiseFlushAll(): Promise; +} + +interface InfluxDBClientConstructor { + readonly ClassName: 'InfluxDBClient'; + new (clientConfig?: InfluxDBClientConfig): InfluxDBClient; +} + +export const InfluxDBClient: InfluxDBClientConstructor; diff --git a/src/influxdbclient/src/Server/Utils/InfluxDBErrorUtils.d.ts b/src/influxdbclient/src/Server/Utils/InfluxDBErrorUtils.d.ts new file mode 100644 index 00000000000..8228fb90b04 --- /dev/null +++ b/src/influxdbclient/src/Server/Utils/InfluxDBErrorUtils.d.ts @@ -0,0 +1,9 @@ +export interface InfluxDBError { + code: string; + message: string; +} + +export namespace InfluxDBErrorUtils { + function tryParseErrorBody(body: string): InfluxDBError | undefined; + function isInfluxDBError(value: unknown): value is InfluxDBError; +} diff --git a/src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.d.ts b/src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.d.ts new file mode 100644 index 00000000000..0e82f3ef190 --- /dev/null +++ b/src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.d.ts @@ -0,0 +1,28 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; +import { InfluxDBClientConfig } from '../Config/InfluxDBClientConfigUtils'; +import { + ConvertTime, + InfluxDBTags, +} from '../../Shared/Config/InfluxDBPointSettings'; +import { InfluxDBPoint } from '../../Shared/Write/InfluxDBPoint'; +import { Promise } from '@quenty/promise'; + +interface InfluxDBWriteAPI extends BaseObject { + RequestFinished: Signal; + Destroying: Signal; + SetPrintDebugWriteEnabled(printDebugEnabled: boolean): void; + SetClientConfig(clientConfig: InfluxDBClientConfig): void; + SetDefaultTags(tags: InfluxDBTags): void; + SetConvertTime(convertTime: ConvertTime | undefined): void; + QueuePoint(point: InfluxDBPoint): void; + QueuePoints(points: InfluxDBPoint[]): void; + PromiseFlush(): Promise; +} + +interface InfluxDBWriteAPIConstructor { + readonly ClassName: 'InfluxDBWriteAPI'; + new (org: string, bucket: string, precision?: string): InfluxDBWriteAPI; +} + +export const InfluxDBWriteAPI: InfluxDBWriteAPIConstructor; diff --git a/src/influxdbclient/src/Server/Write/InfluxDBWriteBuffer.d.ts b/src/influxdbclient/src/Server/Write/InfluxDBWriteBuffer.d.ts new file mode 100644 index 00000000000..8017063b688 --- /dev/null +++ b/src/influxdbclient/src/Server/Write/InfluxDBWriteBuffer.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { InfluxDBWriteOptions } from '../Config/InfluxDBWriteOptionUtils'; + +interface InfluxDBWriteBuffer extends BaseObject { + Add(entry: string): void; + PromiseFlush(): Promise; +} + +interface InfluxDBWriteBufferConstructor { + readonly ClassName: 'InfluxDBWriteBuffer'; + new ( + writeOptions: InfluxDBWriteOptions, + promiseHandleFlush: (entries: string[]) => Promise + ): InfluxDBWriteBuffer; +} + +export const InfluxDBWriteBuffer: InfluxDBWriteBufferConstructor; diff --git a/src/influxdbclient/src/Shared/Config/InfluxDBPointSettings.d.ts b/src/influxdbclient/src/Shared/Config/InfluxDBPointSettings.d.ts new file mode 100644 index 00000000000..7c3e37ec377 --- /dev/null +++ b/src/influxdbclient/src/Shared/Config/InfluxDBPointSettings.d.ts @@ -0,0 +1,17 @@ +export type InfluxDBTags = Record; + +export type ConvertTime = (time?: DateTime | number | string) => number; + +interface InfluxDBPointSettings { + SetDefaultTags(tags: InfluxDBTags): void; + GetDefaultTags(): InfluxDBTags; + SetConvertTime(convertTime: ConvertTime | undefined): void; + GetConvertTime(): ConvertTime | undefined; +} + +interface InfluxDBPointSettingsConstructor { + readonly ClassName: 'InfluxDBPointSettings'; + new (): InfluxDBPointSettings; +} + +export const InfluxDBPointSettings: InfluxDBPointSettingsConstructor; diff --git a/src/influxdbclient/src/Shared/Utils/InfluxDBEscapeUtils.d.ts b/src/influxdbclient/src/Shared/Utils/InfluxDBEscapeUtils.d.ts new file mode 100644 index 00000000000..a9e341b7737 --- /dev/null +++ b/src/influxdbclient/src/Shared/Utils/InfluxDBEscapeUtils.d.ts @@ -0,0 +1,9 @@ +export type EscapeTable = Record; + +export namespace InfluxDBEscapeUtils { + function createEscaper(subTable: EscapeTable): (str: string) => string; + function createQuotedEscaper(subTable: EscapeTable): (str: string) => string; + const measurement: (str: string) => string; + const quoted: (str: string) => string; + const tag: (str: string) => string; +} diff --git a/src/influxdbclient/src/Shared/Write/InfluxDBPoint.d.ts b/src/influxdbclient/src/Shared/Write/InfluxDBPoint.d.ts new file mode 100644 index 00000000000..00a19d58803 --- /dev/null +++ b/src/influxdbclient/src/Shared/Write/InfluxDBPoint.d.ts @@ -0,0 +1,32 @@ +import { InfluxDBPointSettings } from '../Config/InfluxDBPointSettings'; + +export interface InfluxDBPointTableData { + measurementName?: string; + timestamp?: DateTime | string | number; + tags: Record; + fields: Record; +} + +interface InfluxDBPoint { + SetMeasurementName(name: string | undefined): void; + GetMeasurementName(): string | undefined; + ToTableData(): InfluxDBPointTableData; + SetTimestamp(timestamp: DateTime | undefined): void; + AddTag(tagKey: string, tagValue: string): void; + AddIntField(fieldName: string, value: number): void; + AddUintField(fieldName: string, value: number): void; + AddFloatField(fieldName: string, value: number): void; + AddBooleanField(fieldName: string, value: boolean): void; + AddStringField(fieldName: string, value: string): void; + ToLineProtocol(pointSettings: InfluxDBPointSettings): string | undefined; +} + +interface InfluxDBPointConstructor { + readonly ClassName: 'InfluxDBPoint'; + new (measurementName?: string): InfluxDBPoint; + + fromTableData: (value: InfluxDBPointTableData) => InfluxDBPoint; + isInfluxDBPoint: (value: unknown) => value is InfluxDBPoint; +} + +export const InfluxDBPoint: InfluxDBPointConstructor; diff --git a/src/inputkeymaputils/index.d.ts b/src/inputkeymaputils/index.d.ts new file mode 100644 index 00000000000..87cddb95442 --- /dev/null +++ b/src/inputkeymaputils/index.d.ts @@ -0,0 +1,12 @@ +export * from './src/Client/InputKeyMapListUtils'; +export * from './src/Client/InputKeyMapServiceClient'; +export * from './src/Server/InputKeyMapService'; +export * from './src/Shared/InputKeyMap'; +export * from './src/Shared/InputKeyMapList'; +export * from './src/Shared/InputKeyMapListProvider'; +export * from './src/Shared/InputKeyMapRegistryServiceShared'; +export * from './src/Shared/InputKeyMapTranslator'; +export * from './src/Shared/ProximityPromptInputUtils'; +export * from './src/Shared/Types/InputChordUtils'; +export * from './src/Shared/Types/InputTypeUtils'; +export * from './src/Shared/Types/SlottedTouchButtonUtils'; diff --git a/src/inputkeymaputils/src/Client/InputKeyMapListUtils.d.ts b/src/inputkeymaputils/src/Client/InputKeyMapListUtils.d.ts new file mode 100644 index 00000000000..f6c6152b9f9 --- /dev/null +++ b/src/inputkeymaputils/src/Client/InputKeyMapListUtils.d.ts @@ -0,0 +1,24 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputKeyMapList } from '../Shared/InputKeyMapList'; +import { InputModeType, InputModeTypeSelector } from '@quenty/inputmode'; +import { Observable } from '@quenty/rx'; +import { InputType } from '../Shared/Types/InputTypeUtils'; + +export namespace InputKeyMapListUtils { + function getNewInputModeTypeSelector( + inputKeyMapList: InputKeyMapList, + serviceBag: ServiceBag + ): InputModeTypeSelector; + function observeActiveInputKeyMap( + inputKeyMapList: InputKeyMapList, + serviceBag: ServiceBag + ): Observable; + function observeActiveInputTypesList( + inputKeyMapList: InputKeyMapList, + serviceBag: ServiceBag + ): Observable; + function observeActiveInputModeType( + inputKeyMapList: InputKeyMapList, + serviceBag: ServiceBag + ): Observable; +} diff --git a/src/inputkeymaputils/src/Client/InputKeyMapServiceClient.d.ts b/src/inputkeymaputils/src/Client/InputKeyMapServiceClient.d.ts new file mode 100644 index 00000000000..3445d6704d3 --- /dev/null +++ b/src/inputkeymaputils/src/Client/InputKeyMapServiceClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputKeyMapList } from '../Shared/InputKeyMapList'; + +export interface InputKeyMapServiceClient { + readonly ServiceName: 'InputKeyMapServiceClient'; + Init(serviceBag: ServiceBag): void; + FindInputKeyMapList( + providerName: string, + listName: string + ): InputKeyMapList | undefined; + Destroy(): void; +} diff --git a/src/inputkeymaputils/src/Server/InputKeyMapService.d.ts b/src/inputkeymaputils/src/Server/InputKeyMapService.d.ts new file mode 100644 index 00000000000..0df6ce72224 --- /dev/null +++ b/src/inputkeymaputils/src/Server/InputKeyMapService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface InputKeyMapService { + readonly ServiceName: 'InputKeyMapService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/inputkeymaputils/src/Shared/InputKeyMap.d.ts b/src/inputkeymaputils/src/Shared/InputKeyMap.d.ts new file mode 100644 index 00000000000..d45ec31a7c4 --- /dev/null +++ b/src/inputkeymaputils/src/Shared/InputKeyMap.d.ts @@ -0,0 +1,21 @@ +import { InputModeType } from '@quenty/inputmode'; +import { InputType } from './Types/InputTypeUtils'; +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface InputKeyMap extends BaseObject { + GetInputModeType(): InputModeType; + SetInputTypesList(inputTypes: InputType[]): void; + SetDefaultInputTypesList(inputTypes: InputType[]): void; + GetDefaultInputTypesList(): InputType[]; + RestoreDefault(): void; + ObserveInputTypesList(): Observable; + GetInputTypesList(): InputType[]; +} + +interface InputKeyMapConstructor { + readonly ClassName: 'InputKeyMap'; + new (inputModeType: InputModeType, inputTypes?: InputType[]): InputKeyMap; +} + +export const InputKeyMap: InputKeyMapConstructor; diff --git a/src/inputkeymaputils/src/Shared/InputKeyMapList.d.ts b/src/inputkeymaputils/src/Shared/InputKeyMapList.d.ts new file mode 100644 index 00000000000..6e0cfcc15ea --- /dev/null +++ b/src/inputkeymaputils/src/Shared/InputKeyMapList.d.ts @@ -0,0 +1,67 @@ +import { BaseObject } from '@quenty/baseobject'; +import { InputKeyMap } from './InputKeyMap'; +import { InputModeKey, InputModeType } from '@quenty/inputmode'; +import { InputType } from './Types/InputTypeUtils'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { SlottedTouchButtonData } from './Types/SlottedTouchButtonUtils'; + +export interface InputKeyMapListOptions { + bindingName: string; + rebindable: boolean; +} + +interface InputKeyMapList extends BaseObject { + IsUserRebindable(): boolean; + GetBindingName(): string; + GetBindingTranslationKey(): string; + Add(inputKeyMap: InputKeyMap): void; + GetListName(): string; + SetInputTypesList( + inputModeType: InputModeType, + inputTypes?: InputType[] + ): void; + SetDefaultInputTypesList( + inputModeType: InputModeType, + inputTypes?: InputType[] + ): void; + GetInputTypesList(inputModeType: InputModeType): InputType[]; + GetInputKeyMaps(): InputKeyMap[]; + GetDefaultInputTypesList(inputModeType: InputModeType): InputType[]; + ObservePairsBrio(): Observable< + Brio<[inputModeType: InputModeType, inputKeyMap: InputKeyMap]> + >; + RestoreDefault(): void; + RemoveInputModeType(inputModeType: InputModeType): void; + ObserveInputKeyMapsBrio(): Observable>; + ObserveInputModesTypesBrio(): Observable>; + ObserveInputKeyMapForInputMode( + inputModeType: InputModeType + ): Observable; + ObserveIsTapInWorld(): Observable; + ObserveIsRobloxTouchButton(): Observable; + IsRobloxTouchButton(): boolean; + IsTouchTapInWorld(): boolean; + ObserveInputEnumsList(): Observable; + GetInputEnumsList(): InputType[]; + ObserveInputEnumsSet(): Observable>; + ObserveSlottedTouchButtonDataBrio(): Observable>; + GetModifierChords(): {}; +} + +interface InputKeyMapListConstructor { + readonly ClassName: 'InputKeyMapList'; + new ( + inputMapName: string, + inputKeyMapList: InputKeyMap[], + options: InputKeyMapListOptions + ): InputKeyMapList; + + fromInputKeys: ( + inputKeys: InputModeKey[], + options?: InputKeyMapListOptions + ) => InputKeyMapList; + isInputKeyMapList: (value: unknown) => value is InputKeyMapList; +} + +export const InputKeyMapList: InputKeyMapListConstructor; diff --git a/src/inputkeymaputils/src/Shared/InputKeyMapListProvider.d.ts b/src/inputkeymaputils/src/Shared/InputKeyMapListProvider.d.ts new file mode 100644 index 00000000000..ad61681ed46 --- /dev/null +++ b/src/inputkeymaputils/src/Shared/InputKeyMapListProvider.d.ts @@ -0,0 +1,29 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputKeyMapList } from './InputKeyMapList'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +interface InputKeyMapListProvider { + Init(serviceBag: ServiceBag): void; + Start(): void; + GetProviderName(): string; + GetInputKeyMapList(keyMapListName: string): InputKeyMapList; + FindInputKeyMapList(keyMapListName: string): InputKeyMapList | undefined; + Add(inputKeyMapList: InputKeyMapList): void; + ObserveInputKeyMapListsBrio(): Observable>; + Destroy(): void; +} + +interface InputKeyMapListProviderConstructor { + readonly ClassName: 'InputKeyMapListProvider'; + readonly ServiceName: 'InputKeyMapListProvider'; + new ( + providerName: string, + createDefaults: ( + this: InputKeyMapListProvider, + serviceBag: ServiceBag + ) => void + ): InputKeyMapListProvider; +} + +export const InputKeyMapListProvider: InputKeyMapListProviderConstructor; diff --git a/src/inputkeymaputils/src/Shared/InputKeyMapRegistryServiceShared.d.ts b/src/inputkeymaputils/src/Shared/InputKeyMapRegistryServiceShared.d.ts new file mode 100644 index 00000000000..3719e46a20a --- /dev/null +++ b/src/inputkeymaputils/src/Shared/InputKeyMapRegistryServiceShared.d.ts @@ -0,0 +1,23 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputKeyMapListProvider } from './InputKeyMapListProvider'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { InputKeyMapList } from './InputKeyMapList'; + +export interface InputKeyMapRegistryServiceShared { + readonly ServiceName: 'InputKeyMapRegistryServiceShared'; + Init(serviceBag: ServiceBag): void; + RegisterProvider(provider: InputKeyMapListProvider): void; + ObserveProvidersBrio(): Observable>; + ObserveInputKeyMapListsBrio(): Observable>; + GetProvider(providerName: string): InputKeyMapListProvider | undefined; + ObserveInputKeyMapList( + providerName: string | Observable, + inputKeyMapListName: string | Observable + ): Observable; + FindInputKeyMapList( + providerName: string, + inputKeyMapListName: string + ): InputKeyMapList | undefined; + Destroy(): void; +} diff --git a/src/inputkeymaputils/src/Shared/InputKeyMapTranslator.d.ts b/src/inputkeymaputils/src/Shared/InputKeyMapTranslator.d.ts new file mode 100644 index 00000000000..dd2ac42657c --- /dev/null +++ b/src/inputkeymaputils/src/Shared/InputKeyMapTranslator.d.ts @@ -0,0 +1,3 @@ +import { JSONTranslator } from '@quenty/clienttranslator'; + +export const InputKeyMapTranslator: JSONTranslator; diff --git a/src/inputkeymaputils/src/Shared/ProximityPromptInputUtils.d.ts b/src/inputkeymaputils/src/Shared/ProximityPromptInputUtils.d.ts new file mode 100644 index 00000000000..18b4f8daa29 --- /dev/null +++ b/src/inputkeymaputils/src/Shared/ProximityPromptInputUtils.d.ts @@ -0,0 +1,14 @@ +import { InputModeType } from '@quenty/inputmode'; +import { InputKeyMapList } from './InputKeyMapList'; + +export namespace ProximityPromptInputUtils { + function newInputKeyMapFromPrompt(prompt: ProximityPrompt): InputKeyMapList; + function configurePromptFromInputKeyMap( + prompt: ProximityPrompt, + inputKeyMapList: InputKeyMapList + ): void; + function getFirstInputKeyCode( + inputKeyMapList: InputKeyMapList, + inputModeType: InputModeType + ): Enum.KeyCode | undefined; +} diff --git a/src/inputkeymaputils/src/Shared/Types/InputChordUtils.d.ts b/src/inputkeymaputils/src/Shared/Types/InputChordUtils.d.ts new file mode 100644 index 00000000000..721907fd2dd --- /dev/null +++ b/src/inputkeymaputils/src/Shared/Types/InputChordUtils.d.ts @@ -0,0 +1,13 @@ +export interface ModifierInputChord { + type: 'ModifierInputChord'; + modifiers: Enum.KeyCode[]; + keyCode: Enum.KeyCode; +} + +export namespace InputChordUtils { + function isModifierInputChord(value: unknown): value is ModifierInputChord; + function createModifierInputChord( + modifiers: Enum.KeyCode[], + keyCode: Enum.KeyCode + ): ModifierInputChord; +} diff --git a/src/inputkeymaputils/src/Shared/Types/InputTypeUtils.d.ts b/src/inputkeymaputils/src/Shared/Types/InputTypeUtils.d.ts new file mode 100644 index 00000000000..1abd28686af --- /dev/null +++ b/src/inputkeymaputils/src/Shared/Types/InputTypeUtils.d.ts @@ -0,0 +1,23 @@ +import { SlottedTouchButton } from './SlottedTouchButtonUtils'; + +export type InputType = + | Enum.UserInputType + | Enum.KeyCode + | SlottedTouchButton + | 'TouchButton' + | 'Tap' + | 'Drag'; + +export namespace InputTypeUtils { + function isKnownInputType(value: unknown): value is InputType; + function isTapInWorld(value: unknown): value is 'Tap'; + function isDrag(value: unknown): value is 'Drag'; + function isRobloxTouchButton(value: unknown): value is 'TouchButton'; + function createTapInWorld(): 'Tap'; + function createRobloxTouchButton(): 'TouchButton'; + function getUniqueKeyForInputType(inputType: InputType): InputType | string; + function areInputTypesListsEquivalent( + a: InputType[], + b: InputType[] + ): boolean; +} diff --git a/src/inputkeymaputils/src/Shared/Types/SlottedTouchButtonUtils.d.ts b/src/inputkeymaputils/src/Shared/Types/SlottedTouchButtonUtils.d.ts new file mode 100644 index 00000000000..80e953da099 --- /dev/null +++ b/src/inputkeymaputils/src/Shared/Types/SlottedTouchButtonUtils.d.ts @@ -0,0 +1,35 @@ +import { InputModeType } from '@quenty/inputmode'; +import { InputKeyMapList } from '../InputKeyMapList'; + +export type SlotId = + | 'primary1' + | 'primary2' + | 'primary3' + | 'primary4' + | 'primary5' + | 'inner1' + | 'inner2' + | 'jumpbutton' + | 'touchpad1'; + +export interface SlottedTouchButton { + type: 'SlottedTouchButton'; + slotId: SlotId; +} + +export interface SlottedTouchButtonData { + slotId: SlotId; + inputModeType: InputModeType; +} + +export namespace SlottedTouchButtonUtils { + function createSlottedTouchButton(slotId: SlotId): SlottedTouchButton; + function isSlottedTouchButton(value: unknown): value is SlottedTouchButton; + function createTouchButtonData( + slotId: SlotId, + inputModeType: InputModeType + ): SlottedTouchButtonData; + function getSlottedTouchButtonData( + inputKeyMapList: InputKeyMapList + ): SlottedTouchButtonData[]; +} diff --git a/src/inputmode/index.d.ts b/src/inputmode/index.d.ts new file mode 100644 index 00000000000..0e6a3dce220 --- /dev/null +++ b/src/inputmode/index.d.ts @@ -0,0 +1,6 @@ +export * from './src/Client/InputMode'; +export * from './src/Client/InputModeProcessor'; +export * from './src/Client/InputModeServiceClient'; +export * from './src/Client/InputModeTypeSelector'; +export * from './src/Shared/InputModeType'; +export * from './src/Shared/InputModeTypes'; diff --git a/src/inputmode/src/Client/InputMode.d.ts b/src/inputmode/src/Client/InputMode.d.ts new file mode 100644 index 00000000000..2ba73fba26f --- /dev/null +++ b/src/inputmode/src/Client/InputMode.d.ts @@ -0,0 +1,21 @@ +import { Signal } from '@quenty/signal'; +import { InputModeKey, InputModeType } from '../Shared/InputModeType'; + +interface InputMode { + Enabled: Signal; + GetLastEnabledTime(): number; + GetKeys(): InputModeKey[]; + IsValid(inputType: InputModeKey): boolean; + Enable(): void; + Evaluate(inputObject: InputObject): void; + Destroy(): void; +} + +interface InputModeConstructor { + readonly ClassName: 'InputMode'; + new (inputModeType: InputModeType): InputMode; + + isInputMode: (value: unknown) => value is InputMode; +} + +export const InputMode: InputModeConstructor; diff --git a/src/inputmode/src/Client/InputModeProcessor.d.ts b/src/inputmode/src/Client/InputModeProcessor.d.ts new file mode 100644 index 00000000000..1414255e433 --- /dev/null +++ b/src/inputmode/src/Client/InputModeProcessor.d.ts @@ -0,0 +1,14 @@ +import { InputMode } from './InputMode'; + +interface InputModeProcessor { + AddInputMode(inputMode: InputMode): void; + GetStates(): InputMode[]; + Evaluate(inputObject: InputObject): void; +} + +interface InputModeProcessorConstructor { + readonly ClassName: 'InputModeProcessor'; + new (inputModes?: InputMode[]): InputModeProcessor; +} + +export const InputModeProcessor: InputModeProcessorConstructor; diff --git a/src/inputmode/src/Client/InputModeServiceClient.d.ts b/src/inputmode/src/Client/InputModeServiceClient.d.ts new file mode 100644 index 00000000000..83c5e2ef405 --- /dev/null +++ b/src/inputmode/src/Client/InputModeServiceClient.d.ts @@ -0,0 +1,10 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputModeType } from '../Shared/InputModeType'; +import { InputMode } from './InputMode'; + +export interface InputModeServiceClient { + readonly ServiceName: 'InputModeServiceClient'; + Init(serviceBag: ServiceBag): void; + GetInputMode(inputModeType: InputModeType): InputMode; + Destroy(): void; +} diff --git a/src/inputmode/src/Client/InputModeTypeSelector.d.ts b/src/inputmode/src/Client/InputModeTypeSelector.d.ts new file mode 100644 index 00000000000..bde9ed2d3cd --- /dev/null +++ b/src/inputmode/src/Client/InputModeTypeSelector.d.ts @@ -0,0 +1,39 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { InputModeType } from '../Shared/InputModeType'; +import { Signal } from '@quenty/signal'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { Maid } from '@quenty/maid'; + +interface InputModeTypeSelector { + Changed: Signal<[newMode: InputModeType, oldMode?: InputModeType]>; + readonly Value: InputModeType | undefined; + GetActiveInputType(): InputModeType | undefined; + ObserveActiveInputType(): Observable; + IsActive(inputModeType: InputModeType): boolean; + ObserveIsActive(inputModeType: InputModeType): Observable; + Bind( + updateBindFunction: ( + inputModeType: InputModeType | undefined, + maid: Maid + ) => void + ): this; + RemoveInputModeType(inputModeType: InputModeType): void; + AddInputModeType(inputModeType: InputModeType): void; + Destroy(): void; +} + +interface InputModeTypeSelectorConstructor { + readonly ClassName: 'InputModeTypeSelector'; + new ( + serviceBag: ServiceBag, + inputModesTypes?: InputModeType[] + ): InputModeTypeSelector; + + fromObservableBrio: ( + ServiceBag: ServiceBag, + observeInputModesBrio: Observable> + ) => InputModeTypeSelector; +} + +export const InputModeTypeSelector: InputModeTypeSelectorConstructor; diff --git a/src/inputmode/src/Shared/InputModeType.d.ts b/src/inputmode/src/Shared/InputModeType.d.ts new file mode 100644 index 00000000000..cfac419e29b --- /dev/null +++ b/src/inputmode/src/Shared/InputModeType.d.ts @@ -0,0 +1,20 @@ +export type InputModeKey = Enum.UserInputType | Enum.KeyCode | string; +export type InputModeTypeDefinition = (InputModeType | InputModeKey)[]; + +interface InputModeType { + Name: string; + IsValid(inputType: InputModeKey): boolean; + GetKeys(): InputModeKey[]; +} + +interface InputModeTypeConstructor { + readonly ClassName: 'InputModeType'; + new ( + name: string, + typesAndInputModeTypes: InputModeTypeDefinition + ): InputModeType; + + isInputModeType: (value: unknown) => value is InputModeType; +} + +export const InputModeType: InputModeTypeConstructor; diff --git a/src/inputmode/src/Shared/InputModeTypes.d.ts b/src/inputmode/src/Shared/InputModeTypes.d.ts new file mode 100644 index 00000000000..e432b2e843f --- /dev/null +++ b/src/inputmode/src/Shared/InputModeTypes.d.ts @@ -0,0 +1,14 @@ +import { InputModeType } from './InputModeType'; + +export namespace InputModeTypes { + const Keypad: InputModeType; + const Keyboard: InputModeType; + const ArrowKeys: InputModeType; + const WASD: InputModeType; + const Mouse: InputModeType; + const KeyboardAndMouse: InputModeType; + const Touch: InputModeType; + const DPad: InputModeType; + const Thumbsticks: InputModeType; + const Gamepads: InputModeType; +} diff --git a/src/inputobjectutils/index.d.ts b/src/inputobjectutils/index.d.ts new file mode 100644 index 00000000000..b7860606876 --- /dev/null +++ b/src/inputobjectutils/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/InputObjectUtils'; +export * from './src/Client/RxInputObjectUtils'; +export * from './src/Client/InputObjectRayUtils'; +export * from './src/Client/InputObjectTracker'; diff --git a/src/inputobjectutils/src/Client/InputObjectRayUtils.d.ts b/src/inputobjectutils/src/Client/InputObjectRayUtils.d.ts new file mode 100644 index 00000000000..7adb50e3d6e --- /dev/null +++ b/src/inputobjectutils/src/Client/InputObjectRayUtils.d.ts @@ -0,0 +1,31 @@ +export namespace InputObjectRayUtils { + function cameraRayFromInputObject( + inputObject: InputObject, + distance: number, + offset?: Vector3 | Vector2, + camera?: Camera + ): Ray; + function cameraRayFromMouse( + mouse: Mouse, + distance: number, + offset?: Vector3 | Vector2, + camera?: Camera + ): Ray; + function cameraRayFromInputObjectWithOffset( + inputObject: InputObject, + distance: number | undefined, + offset: Vector3 | Vector2, + camera?: Camera + ): Ray; + function cameraRayFromScreenPosition( + position: Vector3 | Vector2, + distance?: number, + camera?: Camera + ): Ray; + function cameraRayFromViewportPosition( + position: Vector3 | Vector2, + distance?: number, + camera?: Camera + ): Ray; + function generateCircleRays(ray: Ray, count: number, radius: number): Ray[]; +} diff --git a/src/inputobjectutils/src/Client/InputObjectTracker.d.ts b/src/inputobjectutils/src/Client/InputObjectTracker.d.ts new file mode 100644 index 00000000000..4edbbf96db7 --- /dev/null +++ b/src/inputobjectutils/src/Client/InputObjectTracker.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '../../../baseobject'; +import { Observable } from '../../../rx'; +import { Signal } from '@quenty/signal'; + +interface InputObjectTracker extends BaseObject { + InputEnded: Signal; + ObserveInputEnded(): Observable; + GetInitialPosition(): Vector2; + GetPosition(): Vector2; + GetRay(rayDistance?: number): Ray; + SetCamera(camera: Camera): void; +} + +interface InputObjectTrackerConstructor { + readonly ClassName: 'InputObjectTracker'; + new (initialInputObject: InputObject): InputObjectTracker; +} + +export const InputObjectTracker: InputObjectTrackerConstructor; diff --git a/src/inputobjectutils/src/Client/InputObjectUtils.d.ts b/src/inputobjectutils/src/Client/InputObjectUtils.d.ts new file mode 100644 index 00000000000..4a47a4443a4 --- /dev/null +++ b/src/inputobjectutils/src/Client/InputObjectUtils.d.ts @@ -0,0 +1,20 @@ +export namespace InputObjectUtils { + function isMouseUserInputType( + userInputType: Enum.UserInputType + ): userInputType is + | Enum.UserInputType.MouseButton1 + | Enum.UserInputType.MouseButton2 + | Enum.UserInputType.MouseButton3 + | Enum.UserInputType.MouseWheel + | Enum.UserInputType.MouseMovement; + function isMouseButtonInputType( + userInputType: Enum.UserInputType + ): userInputType is + | Enum.UserInputType.MouseButton1 + | Enum.UserInputType.MouseButton2 + | Enum.UserInputType.MouseButton3; + function isSameInputObject( + inputObject1: InputObject, + inputObject2: InputObject + ): boolean; +} diff --git a/src/inputobjectutils/src/Client/RxInputObjectUtils.d.ts b/src/inputobjectutils/src/Client/RxInputObjectUtils.d.ts new file mode 100644 index 00000000000..22ee4c748c3 --- /dev/null +++ b/src/inputobjectutils/src/Client/RxInputObjectUtils.d.ts @@ -0,0 +1,5 @@ +import { Observable } from '../../../rx'; + +export namespace RxInputObjectUtils { + function observeInputObjectEnded(initialInputObject: InputObject): Observable; +} diff --git a/src/insertserviceutils/index.d.ts b/src/insertserviceutils/index.d.ts new file mode 100644 index 00000000000..6f7afd47553 --- /dev/null +++ b/src/insertserviceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/InsertServiceUtils'; diff --git a/src/insertserviceutils/src/Shared/InsertServiceUtils.d.ts b/src/insertserviceutils/src/Shared/InsertServiceUtils.d.ts new file mode 100644 index 00000000000..63aaa42ae00 --- /dev/null +++ b/src/insertserviceutils/src/Shared/InsertServiceUtils.d.ts @@ -0,0 +1,5 @@ +import { Promise } from '@quenty/promise'; + +export namespace InsertServiceUtils { + function promiseAsset(assetId: number): Promise; +} diff --git a/src/instanceutils/index.d.ts b/src/instanceutils/index.d.ts new file mode 100644 index 00000000000..dc26a76c23d --- /dev/null +++ b/src/instanceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RxInstanceUtils'; diff --git a/src/instanceutils/src/Shared/RxInstanceUtils.d.ts b/src/instanceutils/src/Shared/RxInstanceUtils.d.ts new file mode 100644 index 00000000000..8630318657f --- /dev/null +++ b/src/instanceutils/src/Shared/RxInstanceUtils.d.ts @@ -0,0 +1,97 @@ +import { Brio } from '@quenty/brio'; +import { Observable, Predicate } from '@quenty/rx'; + +export namespace RxInstanceUtils { + function observeProperty< + T extends Instance, + K extends keyof InstanceProperties + >(instance: T, propertyName: K): Observable[K]>; + function observeAncestry(instance: Instance): Observable; + function observeFirstAncestorBrio( + instance: Instance, + className: T + ): Observable>; + function observeParentBrio(instance: Instance): Observable>; + function observeFirstAncestor( + instance: Instance, + className: T + ): Observable; + + function observePropertyBrio< + T extends Instance, + K extends keyof InstanceProperties + >( + instance: T, + propertyName: K, + predicate: ( + value: InstanceProperties[K] + ) => value is NonNullable[K]> + ): Observable[K]>>>; + function observePropertyBrio< + T extends Instance, + K extends keyof InstanceProperties + >( + instance: T, + propertyName: K, + predicate: ( + value: InstanceProperties[K] + ) => value is Exclude< + InstanceProperties[K], + NonNullable[K]> + > + ): Observable< + Brio< + Exclude[K], NonNullable[K]>> + > + >; + function observePropertyBrio< + T extends Instance, + K extends keyof InstanceProperties + >( + instance: T, + propertyName: K, + predicate?: (value: InstanceProperties[K]) => boolean + ): Observable[K]>>; + + function observeLastNamedChildBrio( + instance: Instance, + className: T, + name: string + ): Observable>; + function observeChildrenOfNameBrio( + parent: Instance, + className: T, + name: string + ): Observable>; + function observeChildrenOfClassBrio( + parent: Instance, + className: T + ): Observable>; + + function observeChildrenBrio( + parent: Instance, + predicate: (instance: Instance) => instance is T + ): Observable>; + function observeChildrenBrio( + parent: Instance, + predicate?: Predicate + ): Observable>; + + function observeDescendants( + parent: Instance, + predicate: (instance: Instance) => instance is T + ): Observable>; + function observeDescendants( + parent: Instance, + predicate?: Predicate + ): Observable>; + + function observeDescendantsBrio( + parent: Instance, + predicate?: Predicate + ): Observable>; + function observeDescendantsOfClassBrio( + parent: Instance, + className: T + ): Observable>; +} diff --git a/src/isamixin/index.d.ts b/src/isamixin/index.d.ts new file mode 100644 index 00000000000..704aae42021 --- /dev/null +++ b/src/isamixin/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/IsAMixin'; diff --git a/src/isamixin/src/Shared/IsAMixin.d.ts b/src/isamixin/src/Shared/IsAMixin.d.ts new file mode 100644 index 00000000000..9cc5ba15e47 --- /dev/null +++ b/src/isamixin/src/Shared/IsAMixin.d.ts @@ -0,0 +1,8 @@ +export interface IsAMixin { + IsA(className: string): boolean; + CustomIsA(className: string): boolean; +} + +export const IsAMixin: { + Add(classObj: { new (...args: unknown[]): unknown }): void; +}; diff --git a/src/jsonutils/index.d.ts b/src/jsonutils/index.d.ts new file mode 100644 index 00000000000..2388c6c3b35 --- /dev/null +++ b/src/jsonutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/JSONUtils'; diff --git a/src/jsonutils/src/Shared/JSONUtils.d.ts b/src/jsonutils/src/Shared/JSONUtils.d.ts new file mode 100644 index 00000000000..b0331dc1ec2 --- /dev/null +++ b/src/jsonutils/src/Shared/JSONUtils.d.ts @@ -0,0 +1,17 @@ +import { Promise } from '@quenty/promise'; + +export namespace JSONUtils { + function jsonDecode( + str: string + ): LuaTuple< + | [success: true, result: unknown, errorMessage: undefined] + | [success: false, result: undefined, errorMessage: string] + >; + function jsonEncode( + value: unknown + ): LuaTuple< + | [success: true, result: string, errorMessage: undefined] + | [success: false, result: undefined, errorMessage: string] + >; + function promiseJSONDecode(str: string): Promise; +} diff --git a/src/jumpbuttonutils/index.d.ts b/src/jumpbuttonutils/index.d.ts new file mode 100644 index 00000000000..7d2350fc682 --- /dev/null +++ b/src/jumpbuttonutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/JumpButtonUtils'; diff --git a/src/jumpbuttonutils/src/Client/JumpButtonUtils.d.ts b/src/jumpbuttonutils/src/Client/JumpButtonUtils.d.ts new file mode 100644 index 00000000000..9c441223c2c --- /dev/null +++ b/src/jumpbuttonutils/src/Client/JumpButtonUtils.d.ts @@ -0,0 +1,5 @@ +export namespace JumpButtonUtils { + function getJumpButtonPositionAndSize( + screenGuiAbsSize: Vector2 + ): LuaTuple<[position: UDim2, size: number]>; +} diff --git a/src/kinematics/index.d.ts b/src/kinematics/index.d.ts new file mode 100644 index 00000000000..12e2fae7e35 --- /dev/null +++ b/src/kinematics/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/KinematicUtils'; +export * from './src/Shared/Kinematics'; diff --git a/src/kinematics/src/Shared/KinematicUtils.d.ts b/src/kinematics/src/Shared/KinematicUtils.d.ts new file mode 100644 index 00000000000..670dd97b769 --- /dev/null +++ b/src/kinematics/src/Shared/KinematicUtils.d.ts @@ -0,0 +1,11 @@ +type MathLike = number | Vector3 | Vector2; + +export namespace KinematicUtils { + function positionVelocity( + now: number, + t0: number, + p0: T, + v0: T, + a0: T + ): T; +} diff --git a/src/kinematics/src/Shared/Kinematics.d.ts b/src/kinematics/src/Shared/Kinematics.d.ts new file mode 100644 index 00000000000..9ceb0928584 --- /dev/null +++ b/src/kinematics/src/Shared/Kinematics.d.ts @@ -0,0 +1,24 @@ +import { MathLike } from './KinematicUtils'; + +type Kinematics = { + Position: T; + Velocity: T; + Acceleration: T; + StartTime: number; + StartPosition: T; + StartVelocity: T; + Speed: number; + Age: number; + Clock: () => number; + Impulse(velocity: T): void; + TimeSkip(delta: number): void; + SetData(startTime: number, position0: T, velocity0: T, acceleration: T): void; +}; + +interface KinematicsConstructor { + readonly ClassName: 'Kinematics'; + new (): Kinematics; + new (initial: T, clock?: () => number): Kinematics; +} + +export const Kinematics: KinematicsConstructor; diff --git a/src/linearsystemssolver/index.d.ts b/src/linearsystemssolver/index.d.ts new file mode 100644 index 00000000000..bed33b51b74 --- /dev/null +++ b/src/linearsystemssolver/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/LinearSystemsSolverUtils'; diff --git a/src/linearsystemssolver/src/Shared/LinearSystemsSolverUtils.d.ts b/src/linearsystemssolver/src/Shared/LinearSystemsSolverUtils.d.ts new file mode 100644 index 00000000000..e74a702a61c --- /dev/null +++ b/src/linearsystemssolver/src/Shared/LinearSystemsSolverUtils.d.ts @@ -0,0 +1,9 @@ +export namespace LinearSystemsSolverUtils { + function solve(mutSystem: number[][], mutOutput: number[]): number[]; + function solveTridiagonal( + mutMainDiag: number[], + mutUpperDiag: number[], + mutLowerDiag: number[], + mutOutput: number[] + ): number[]; +} diff --git a/src/linkutils/index.d.ts b/src/linkutils/index.d.ts new file mode 100644 index 00000000000..e2e37779152 --- /dev/null +++ b/src/linkutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/LinkUtils'; +export * from './src/Shared/RxLinkUtils'; diff --git a/src/linkutils/src/Shared/LinkUtils.d.ts b/src/linkutils/src/Shared/LinkUtils.d.ts new file mode 100644 index 00000000000..39928a3c62c --- /dev/null +++ b/src/linkutils/src/Shared/LinkUtils.d.ts @@ -0,0 +1,26 @@ +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +export namespace LinkUtils { + function createLink( + linkName: string, + from: Instance, + to: Instance + ): ObjectValue; + function getAllLinkValues(linkName: string, from: Instance): ObjectValue[]; + function setSingleLinkValue( + linkName: string, + from: Instance, + to: Instance + ): ObjectValue | undefined; + function getAllLinks(linkName: string, from: Instance): ObjectValue[]; + function getLinkValue( + linkName: string, + from: Instance + ): ObjectValue | undefined; + function promiseLinkValue( + maid: Maid, + linkName: string, + from: Instance + ): Promise; +} diff --git a/src/linkutils/src/Shared/RxLinkUtils.d.ts b/src/linkutils/src/Shared/RxLinkUtils.d.ts new file mode 100644 index 00000000000..4681e2d3424 --- /dev/null +++ b/src/linkutils/src/Shared/RxLinkUtils.d.ts @@ -0,0 +1,17 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxLinkUtils { + function observeValidLinksBrio( + linkName: string, + parent: Instance + ): Observable>; + function observeLinkValueBrio( + linkName: string, + parent: Instance + ): Observable; + function observeValidityBrio( + linkName: string, + link: Instance + ): Observable<[link: Instance, instance: Instance]>; +} diff --git a/src/lipsum/index.d.ts b/src/lipsum/index.d.ts new file mode 100644 index 00000000000..a6af1e08a68 --- /dev/null +++ b/src/lipsum/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/LipsumUtils'; +export * from './src/Shared/LipsumIconUtils'; diff --git a/src/lipsum/src/Shared/LipsumIconUtils.d.ts b/src/lipsum/src/Shared/LipsumIconUtils.d.ts new file mode 100644 index 00000000000..4a6cdc43aec --- /dev/null +++ b/src/lipsum/src/Shared/LipsumIconUtils.d.ts @@ -0,0 +1,5 @@ +export namespace LipsumIconUtils { + function icon(random?: Random): string; + function outlineIcon(random?: Random): string; + function coloredOutlineIcon(random?: Random): string; +} diff --git a/src/lipsum/src/Shared/LipsumUtils.d.ts b/src/lipsum/src/Shared/LipsumUtils.d.ts new file mode 100644 index 00000000000..ae95e74ada7 --- /dev/null +++ b/src/lipsum/src/Shared/LipsumUtils.d.ts @@ -0,0 +1,16 @@ +export namespace LipsumUtils { + function username(random?: Random): string; + function word(random?: Random): string; + function words(numWords: number, random?: Random): string; + function sentence(numWords?: number, random?: Random): string; + function paragraph( + numSentences?: number, + createSentence?: () => string, + random?: Random + ): string; + function document( + numParagraphs?: number, + createParagraph?: () => string, + random?: Random + ): string; +} diff --git a/src/loader/index.d.ts b/src/loader/index.d.ts new file mode 100644 index 00000000000..cba18435457 --- /dev/null +++ b/src/loader/index.d.ts @@ -0,0 +1 @@ +export * from './src/index'; diff --git a/src/loader/src/index.d.ts b/src/loader/src/index.d.ts new file mode 100644 index 00000000000..0dd37118cc7 --- /dev/null +++ b/src/loader/src/index.d.ts @@ -0,0 +1,19 @@ +type Loader = Record & { + __call(request: string | ModuleScript): unknown; + Destroy(): void; +}; + +interface LoaderConstructor { + readonly ClassName: 'Loader'; + new ( + packages: Instance, + replicationType: 'client' | 'server' | 'shared' | 'plugin' + ): Loader; + + bootstrapGame: (packages: Instance) => Loader; + bootstrapPlugin: (packages: Instance) => Loader; + bootstrapStory: (storyScript: Instance) => Loader; + load: (packagesOrModuleScript: Instance) => Loader; +} + +export const Loader: LoaderConstructor; diff --git a/src/localizedtextutils/index.d.ts b/src/localizedtextutils/index.d.ts new file mode 100644 index 00000000000..43d7c06a833 --- /dev/null +++ b/src/localizedtextutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/LocalizedTextUtils'; diff --git a/src/localizedtextutils/src/Shared/LocalizedTextUtils.d.ts b/src/localizedtextutils/src/Shared/LocalizedTextUtils.d.ts new file mode 100644 index 00000000000..888be0dd2e3 --- /dev/null +++ b/src/localizedtextutils/src/Shared/LocalizedTextUtils.d.ts @@ -0,0 +1,72 @@ +import { JSONTranslator } from '@quenty/clienttranslator'; +import { Observable } from '@quenty/rx'; + +export type TranslationArgs = Record< + string, + LocalizedTextData | number | string +>; + +export interface LocalizedTextData { + translationKey: string; + translationArgs?: TranslationArgs; +} + +export namespace LocalizedTextUtils { + function create( + translationKey: string, + translationArgs?: TranslationArgs + ): LocalizedTextData; + function isLocalizedText(value: unknown): value is LocalizedTextData; + function formatByKeyRecursive( + translator: Translator | JSONTranslator, + translationKey: string, + translationArgs?: TranslationArgs, + extraArgs?: unknown[] | Record + ): string; + function observeFormatByKeyRecursive( + translator: JSONTranslator, + translationKey: string, + translationArgs?: TranslationArgs, + extraArgs?: unknown[] | Record + ): Observable; + function observeLocalizedTextToString( + translator: JSONTranslator, + localizedText: LocalizedTextData, + extraArgs?: unknown[] | Record + ): Observable; + function localizedTextToString( + translator: Translator | JSONTranslator, + localizedText: LocalizedTextData, + extraArgs?: unknown[] | Record + ): string; + function fromJSON(text: string): LocalizedTextData | undefined; + function toJSON(localizedText: LocalizedTextData): string; + function setFromAttribute( + obj: Instance, + attributeName: string, + translationKey: string, + translationArgs: TranslationArgs + ): void; + function getFromAttribute( + obj: Instance, + attributeName: string + ): LocalizedTextData | undefined; + function getTranslationFromAttribute( + translator: Translator | JSONTranslator, + obj: Instance, + attributeName: string, + extraArgs?: unknown[] | Record + ): string | undefined; + function initializeAttribute( + obj: Instance, + attributeName: string, + defaultTranslationKey: string, + defaultTranslationArgs?: TranslationArgs + ): void; + function observeTranslation( + translator: JSONTranslator, + obj: Instance, + attributeName: string, + extraArgs?: unknown[] | Record + ): Observable; +} diff --git a/src/lrucache/index.d.ts b/src/lrucache/index.d.ts new file mode 100644 index 00000000000..c9a68b321db --- /dev/null +++ b/src/lrucache/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/LRUCache'; diff --git a/src/lrucache/src/Shared/LRUCache.d.ts b/src/lrucache/src/Shared/LRUCache.d.ts new file mode 100644 index 00000000000..89c6f88527d --- /dev/null +++ b/src/lrucache/src/Shared/LRUCache.d.ts @@ -0,0 +1,13 @@ +interface LRUCache { + get(key: unknown): unknown; + set(key: unknown, value: unknown, bytes?: number): void; + delete(key: unknown): void; + pairs(): IterableFunction>; +} + +interface LRUCacheConstructor { + readonly ClassName: 'LRUCache'; + new (maxSize: number, maxBytes?: number): LRUCache; +} + +export const LRUCache: LRUCacheConstructor; diff --git a/src/maid/index.d.ts b/src/maid/index.d.ts new file mode 100644 index 00000000000..320c18a2a73 --- /dev/null +++ b/src/maid/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Maid'; +export * from './src/Shared/MaidTaskUtils'; diff --git a/src/maid/src/Shared/Maid.d.ts b/src/maid/src/Shared/Maid.d.ts new file mode 100644 index 00000000000..f40fab1842b --- /dev/null +++ b/src/maid/src/Shared/Maid.d.ts @@ -0,0 +1,24 @@ +export type MaidTask = + | (() => unknown) + | thread + | RBXScriptConnection + | Maid + | { + Destroy(): void; + }; + +type Maid = { + [index in number | string]: MaidTask | undefined; +} & { + GiveTask(task: MaidTask): number; + Add(task: T): T; + DoCleaning(): void; + Destroy(): void; +} & Map; + +interface MaidConstructor { + readonly ClassName: 'Maid'; + new (): Maid; +} + +export const Maid: MaidConstructor; diff --git a/src/maid/src/Shared/MaidTaskUtils.d.ts b/src/maid/src/Shared/MaidTaskUtils.d.ts new file mode 100644 index 00000000000..026f9527f08 --- /dev/null +++ b/src/maid/src/Shared/MaidTaskUtils.d.ts @@ -0,0 +1,7 @@ +import { MaidTask } from './Maid'; + +export namespace MaidTaskUtils { + function isValidTask(job: unknown): job is MaidTask; + function doTask(job: MaidTask): void; + function delayed(time: number, job: MaidTask): () => void; +} diff --git a/src/markdownrender/index.d.ts b/src/markdownrender/index.d.ts new file mode 100644 index 00000000000..0a8dc38f606 --- /dev/null +++ b/src/markdownrender/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/MarkdownParser'; +export * from './src/Shared/MarkdownRender'; diff --git a/src/markdownrender/src/Shared/MarkdownParser.d.ts b/src/markdownrender/src/Shared/MarkdownParser.d.ts new file mode 100644 index 00000000000..7c3b9e97859 --- /dev/null +++ b/src/markdownrender/src/Shared/MarkdownParser.d.ts @@ -0,0 +1,29 @@ +export type ParsedMarkdown = ( + | string + | ( + | { + Type: 'List'; + Level: number; + } + | { + Type: 'Header'; + Level: number; + Text: string; + } + ) +)[]; + +interface MarkdownParser { + GetLines(): void; + ParseList(oldLines: ParsedMarkdown): ParsedMarkdown; + ParseHeaders(oldLines: ParsedMarkdown): ParsedMarkdown; + ParseParagraphs(oldLines: ParsedMarkdown): ParsedMarkdown; + Parse(): ParsedMarkdown; +} + +interface MarkdownParserConstructor { + readonly ClassName: 'MarkdownParser'; + new (text: string): MarkdownParser; +} + +export const MarkdownParser: MarkdownParserConstructor; diff --git a/src/markdownrender/src/Shared/MarkdownRender.d.ts b/src/markdownrender/src/Shared/MarkdownRender.d.ts new file mode 100644 index 00000000000..3eefb706260 --- /dev/null +++ b/src/markdownrender/src/Shared/MarkdownRender.d.ts @@ -0,0 +1,26 @@ +import { ParsedMarkdown } from './MarkdownParser'; + +export interface MarkdownRenderOptions { + TextSize: number; + SpaceAfterParagraph: number; +} + +interface MarkdownRender { + WithOptions(options: MarkdownRenderOptions): this; + Render(data: ParsedMarkdown): void; +} + +interface MarkdownRenderConstructor { + readonly ClassName: 'MarkdownRender'; + new (gui: GuiObject, width: number): MarkdownRender; + + SpaceAfterParagraph: 10; + SpaceAfterHeader: 5; + SpaceBetweenList: 2; + TextSize: 18; + Indent: 30; + TextColor3: Color3; + MaxHeaderLevel: 3; +} + +export const MarkdownRender: MarkdownRenderConstructor; diff --git a/src/marketplaceutils/index.d.ts b/src/marketplaceutils/index.d.ts new file mode 100644 index 00000000000..f1f110e0c7f --- /dev/null +++ b/src/marketplaceutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/MarketplaceServiceCache'; +export * from './src/Shared/MarketplaceUtils'; diff --git a/src/marketplaceutils/src/Shared/MarketplaceServiceCache.d.ts b/src/marketplaceutils/src/Shared/MarketplaceServiceCache.d.ts new file mode 100644 index 00000000000..5955b56933d --- /dev/null +++ b/src/marketplaceutils/src/Shared/MarketplaceServiceCache.d.ts @@ -0,0 +1,27 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface MarketplaceServiceCache { + readonly ServiceName: 'MarketplaceServiceCache'; + Init(serviceBag: ServiceBag): void; + PromiseProductInfo( + productId: number, + infoType: Enum.InfoType.Asset + ): AssetProductInfo; + PromiseProductInfo( + productId: number, + infoType: Enum.InfoType.Bundle + ): BundleInfo; + PromiseProductInfo( + productId: number, + infoType: Enum.InfoType.GamePass + ): GamePassProductInfo; + PromiseProductInfo( + productId: number, + infoType: Enum.InfoType.Product + ): DeveloperProductInfo; + PromiseProductInfo( + productId: number, + infoType: Enum.InfoType.Subscription + ): SubscriptionProductInfo; + PromiseProductInfo(productId: number, infoType: Enum.InfoType): ProductInfo; +} diff --git a/src/marketplaceutils/src/Shared/MarketplaceUtils.d.ts b/src/marketplaceutils/src/Shared/MarketplaceUtils.d.ts new file mode 100644 index 00000000000..1beb919b18e --- /dev/null +++ b/src/marketplaceutils/src/Shared/MarketplaceUtils.d.ts @@ -0,0 +1,45 @@ +import { Promise } from '@quenty/promise'; + +export namespace MarketplaceUtils { + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType.Asset + ): AssetProductInfo; + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType.Bundle + ): BundleInfo; + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType.GamePass + ): GamePassProductInfo; + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType.Product + ): DeveloperProductInfo; + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType.Subscription + ): SubscriptionProductInfo; + function promiseProductInfo( + assetId: number, + infoType: Enum.InfoType + ): ProductInfo; + + function promiseUserSubscriptionStatus( + player: Player, + subscriptionId: number + ): Promise; + function promiseUserOwnsGamePass( + userId: number, + gamePassId: number + ): Promise; + function promisePlayerOwnsAsset( + player: Player, + assetId: number + ): Promise; + function promisePlayerOwnsBundle( + player: Player, + bundleId: number + ): Promise; +} diff --git a/src/math/index.d.ts b/src/math/index.d.ts new file mode 100644 index 00000000000..3d0fcb03768 --- /dev/null +++ b/src/math/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Math'; diff --git a/src/math/src/Shared/Math.d.ts b/src/math/src/Shared/Math.d.ts new file mode 100644 index 00000000000..f723c055720 --- /dev/null +++ b/src/math/src/Shared/Math.d.ts @@ -0,0 +1,21 @@ +export namespace Math { + function map( + num: number, + min0: number, + max0: number, + min1: number, + max1: number + ): number; + function jitter( + average: number, + spread?: number | undefined, + randomValue?: number | undefined + ): number; + function isNaN(value: number): boolean; + function isFinite(num: number): boolean; + function lerp(num0: number, num1: number, percent: number): number; + function lawOfCosines(a: number, b: number, c: number): number | undefined; + function round(number: number, precision?: number): number; + function roundUp(number: number, precision: number): number; + function roundDown(number: number, precision: number): number; +} diff --git a/src/memoize/index.d.ts b/src/memoize/index.d.ts new file mode 100644 index 00000000000..db375b61095 --- /dev/null +++ b/src/memoize/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/MemorizeUtils'; diff --git a/src/memoize/src/Shared/MemorizeUtils.d.ts b/src/memoize/src/Shared/MemorizeUtils.d.ts new file mode 100644 index 00000000000..e7c0641c55a --- /dev/null +++ b/src/memoize/src/Shared/MemorizeUtils.d.ts @@ -0,0 +1,12 @@ +export interface CacheConfig { + maxSize: number; +} + +export namespace MemorizeUtils { + function memoize( + func: (...args: T) => R, + cacheConfig?: CacheConfig + ): (...args: T) => R; + function isCacheConfig(value: unknown): value is CacheConfig; + function createCacheConfig(cacheConfig?: CacheConfig): CacheConfig; +} diff --git a/src/memorystoreutils/index.d.ts b/src/memorystoreutils/index.d.ts new file mode 100644 index 00000000000..947b8fb84da --- /dev/null +++ b/src/memorystoreutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/MemoryStoreUtils'; diff --git a/src/memorystoreutils/src/MemoryStoreUtils.d.ts b/src/memorystoreutils/src/MemoryStoreUtils.d.ts new file mode 100644 index 00000000000..a8aceeea2ac --- /dev/null +++ b/src/memorystoreutils/src/MemoryStoreUtils.d.ts @@ -0,0 +1,17 @@ +import { Promise } from '@quenty/promise'; + +export namespace MemoryStoreUtils { + function promiseAdd( + queue: MemoryStoreQueue, + value: unknown, + expirationSeconds: number, + priority?: number + ): Promise; + function promiseRead( + queue: MemoryStoreQueue, + count: number, + allOrNothing: boolean, + waitTimeout: number + ): Promise<[values: unknown[], id: string]>; + function promiseRemove(queue: MemoryStoreQueue, id: string): Promise; +} diff --git a/src/meshutils/index.d.ts b/src/meshutils/index.d.ts new file mode 100644 index 00000000000..51d58121ffb --- /dev/null +++ b/src/meshutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/MeshUtils'; diff --git a/src/meshutils/src/Shared/MeshUtils.d.ts b/src/meshutils/src/Shared/MeshUtils.d.ts new file mode 100644 index 00000000000..afeaf4fda5c --- /dev/null +++ b/src/meshutils/src/Shared/MeshUtils.d.ts @@ -0,0 +1,3 @@ +export namespace MeshUtils { + function getOrCreateMesh(part: BasePart): DataModelMesh | undefined; +} diff --git a/src/messagingserviceutils/index.d.ts b/src/messagingserviceutils/index.d.ts new file mode 100644 index 00000000000..db2b9bd7ea8 --- /dev/null +++ b/src/messagingserviceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/MessagingServiceUtils'; diff --git a/src/messagingserviceutils/src/Server/MessagingServiceUtils.d.ts b/src/messagingserviceutils/src/Server/MessagingServiceUtils.d.ts new file mode 100644 index 00000000000..945ec7332db --- /dev/null +++ b/src/messagingserviceutils/src/Server/MessagingServiceUtils.d.ts @@ -0,0 +1,7 @@ +export namespace MessagingServiceUtils { + function promisePublish(topic: string, message?: unknown): Promise; + function promiseSubscribe( + topic: string, + callback: (...args: unknown[]) => unknown + ): Promise; +} diff --git a/src/metricutils/index.d.ts b/src/metricutils/index.d.ts new file mode 100644 index 00000000000..bb98a2bc06a --- /dev/null +++ b/src/metricutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/MetricUtils'; diff --git a/src/metricutils/src/Shared/MetricUtils.d.ts b/src/metricutils/src/Shared/MetricUtils.d.ts new file mode 100644 index 00000000000..23a2cbd2f01 --- /dev/null +++ b/src/metricutils/src/Shared/MetricUtils.d.ts @@ -0,0 +1,10 @@ +export namespace MetricUtils { + function getSoundDelaySeconds(studs: number): number; + function studsToKilometers(studs: number): number; + function studsToMeters(studs: number): number; + function studsPerSecondToKph(studsPerSecond: number): number; + function studsPerSecondToMetersPerSecond(studsPerSecond: number): number; + function studsPerSecondToMph(studsPerSecond: number): number; + function kphToStudsPerSecond(kph: number): number; + function mphToStudsPerSecond(mph: number): number; +} diff --git a/src/modelappearance/index.d.ts b/src/modelappearance/index.d.ts new file mode 100644 index 00000000000..db5387afdf7 --- /dev/null +++ b/src/modelappearance/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ModelAppearance'; diff --git a/src/modelappearance/src/Shared/ModelAppearance.d.ts b/src/modelappearance/src/Shared/ModelAppearance.d.ts new file mode 100644 index 00000000000..6f7bb893c10 --- /dev/null +++ b/src/modelappearance/src/Shared/ModelAppearance.d.ts @@ -0,0 +1,18 @@ +interface ModelAppearance { + DisableInteractions(): void; + SetCanCollide(canCollide: boolean): void; + ResetCanCollide(): void; + SetTransparency(transparency: number): void; + ResetTransparency(): void; + SetColor(color: Color3): void; + ResetColor(): void; + ResetMaterial(): void; + SetMaterial(material: Enum.Material): void; +} + +interface ModelAppearanceConstructor { + readonly ClassName: 'ModelAppearance'; + new (model: Instance): ModelAppearance; +} + +export const ModelAppearance: ModelAppearanceConstructor; diff --git a/src/modeltransparencyeffect/index.d.ts b/src/modeltransparencyeffect/index.d.ts new file mode 100644 index 00000000000..2a5e5ffc4ca --- /dev/null +++ b/src/modeltransparencyeffect/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/ModelTransparencyEffect'; diff --git a/src/modeltransparencyeffect/src/Client/ModelTransparencyEffect.d.ts b/src/modeltransparencyeffect/src/Client/ModelTransparencyEffect.d.ts new file mode 100644 index 00000000000..127eb88569c --- /dev/null +++ b/src/modeltransparencyeffect/src/Client/ModelTransparencyEffect.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface ModelTransparencyEffect extends BaseObject { + SetAcceleration(acceleration: number): void; + SetTransparency(transparency: number, doNotAnimate?: boolean): void; + IsDoneAnimating(): boolean; + FinishTransparencyAnimation(callback: () => void): void; +} + +interface ModelTransparencyEffectConstructor { + readonly ClassName: 'ModelTransparencyEffect'; + new ( + serviceBag: ServiceBag, + adornee: Instance, + transparencyServiceMethodName?: + | 'SetTransparency' + | 'SetLocalTransparencyModifier' + ): ModelTransparencyEffect; +} + +export const ModelTransparencyEffect: ModelTransparencyEffectConstructor; diff --git a/src/motor6d/index.d.ts b/src/motor6d/index.d.ts new file mode 100644 index 00000000000..5603ace6bb4 --- /dev/null +++ b/src/motor6d/index.d.ts @@ -0,0 +1,11 @@ +export * from './src/Client/Motor6DServiceClient'; +export * from './src/Client/Stack/Motor6DStackClient'; +export * from './src/Server/Motor6DService'; +export * from './src/Server/Stack/Motor6DStack'; +export * from './src/Server/Stack/Motor6DStackHumanoid'; +export * from './src/Shared/Animation/Motor6DAnimator'; +export * from './src/Shared/Animation/Motor6DPhysicsTransformer'; +export * from './src/Shared/Animation/Motor6DSmoothTransformer'; +export * from './src/Shared/Animation/Motor6DTransformer'; +export * from './src/Shared/Stack/Motor6DStackBase'; +export * from './src/Shared/Stack/Motor6DStackInterface'; diff --git a/src/motor6d/src/Client/Motor6DServiceClient.d.ts b/src/motor6d/src/Client/Motor6DServiceClient.d.ts new file mode 100644 index 00000000000..0b240b2f19c --- /dev/null +++ b/src/motor6d/src/Client/Motor6DServiceClient.d.ts @@ -0,0 +1,5 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface Motor6DServiceClient { + Init(serviceBag: ServiceBag): void; +} diff --git a/src/motor6d/src/Client/Stack/Motor6DStackClient.d.ts b/src/motor6d/src/Client/Stack/Motor6DStackClient.d.ts new file mode 100644 index 00000000000..fe80b65d9ea --- /dev/null +++ b/src/motor6d/src/Client/Stack/Motor6DStackClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { Motor6DStackBase } from '../../Shared/Stack/Motor6DStackBase'; + +interface Motor6DStackClient extends Motor6DStackBase {} + +interface Motor6DStackClientConstructor { + readonly ClassName: 'Motor6DStackClient'; + new (motor6D: Motor6D, serviceBag: ServiceBag): Motor6DStackClient; +} + +export const Motor6DStackClient: Binder; diff --git a/src/motor6d/src/Server/Motor6DService.d.ts b/src/motor6d/src/Server/Motor6DService.d.ts new file mode 100644 index 00000000000..9db6671eb83 --- /dev/null +++ b/src/motor6d/src/Server/Motor6DService.d.ts @@ -0,0 +1,5 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface Motor6DService { + Init(serviceBag: ServiceBag): void; +} diff --git a/src/motor6d/src/Server/Stack/Motor6DStack.d.ts b/src/motor6d/src/Server/Stack/Motor6DStack.d.ts new file mode 100644 index 00000000000..da3711e7c62 --- /dev/null +++ b/src/motor6d/src/Server/Stack/Motor6DStack.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { Motor6DStackBase } from '../../Shared/Stack/Motor6DStackBase'; + +interface Motor6DStack extends Motor6DStackBase {} + +interface Motor6DStackConstructor { + readonly ClassName: 'Motor6DStack'; + new (motor6D: Motor6D, serviceBag: ServiceBag): Motor6DStack; +} + +export const Motor6DStack: Binder; diff --git a/src/motor6d/src/Server/Stack/Motor6DStackHumanoid.d.ts b/src/motor6d/src/Server/Stack/Motor6DStackHumanoid.d.ts new file mode 100644 index 00000000000..f58fd02080e --- /dev/null +++ b/src/motor6d/src/Server/Stack/Motor6DStackHumanoid.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { BaseObject } from '@quenty/baseobject'; + +interface Motor6DStackHumanoid extends BaseObject {} + +interface Motor6DStackHumanoidConstructor { + readonly ClassName: 'Motor6DStackHumanoid'; + new (humanoid: Humanoid, serviceBag: ServiceBag): Motor6DStackHumanoid; +} + +export const Motor6DStackHumanoid: PlayerHumanoidBinder; diff --git a/src/motor6d/src/Shared/Animation/Motor6DAnimator.d.ts b/src/motor6d/src/Shared/Animation/Motor6DAnimator.d.ts new file mode 100644 index 00000000000..c15e40bd027 --- /dev/null +++ b/src/motor6d/src/Shared/Animation/Motor6DAnimator.d.ts @@ -0,0 +1,13 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Motor6DTransformer } from './Motor6DTransformer'; + +interface Motor6DAnimator extends BaseObject { + Push(transformer: Motor6DTransformer): void; +} + +interface Motor6DAnimatorConstructor { + readonly ClassName: 'Motor6DAnimator'; + new (motor6D: Motor6D): Motor6DAnimator; +} + +export const Motor6DAnimator: Motor6DAnimatorConstructor; diff --git a/src/motor6d/src/Shared/Animation/Motor6DPhysicsTransformer.d.ts b/src/motor6d/src/Shared/Animation/Motor6DPhysicsTransformer.d.ts new file mode 100644 index 00000000000..e5d17bb0653 --- /dev/null +++ b/src/motor6d/src/Shared/Animation/Motor6DPhysicsTransformer.d.ts @@ -0,0 +1,12 @@ +import { Motor6DTransformer } from './Motor6DTransformer'; + +interface Motor6DPhysicsTransformer extends Motor6DTransformer { + SetSpeed(speed: number): void; +} + +interface Motor6DPhysicsTransformerConstructor { + readonly ClassName: 'Motor6DPhysicsTransformer'; + new (physicsTransform: CFrame): Motor6DPhysicsTransformer; +} + +export const Motor6DPhysicsTransformer: Motor6DPhysicsTransformerConstructor; diff --git a/src/motor6d/src/Shared/Animation/Motor6DSmoothTransformer.d.ts b/src/motor6d/src/Shared/Animation/Motor6DSmoothTransformer.d.ts new file mode 100644 index 00000000000..0f0f30f3534 --- /dev/null +++ b/src/motor6d/src/Shared/Animation/Motor6DSmoothTransformer.d.ts @@ -0,0 +1,15 @@ +import { Motor6DTransformer } from './Motor6DTransformer'; + +interface Motor6DSmoothTransformer extends Motor6DTransformer { + SetSpeed(speed: number): void; + SetTarget(target: number): void; +} + +interface Motor6DSmoothTransformerConstructor { + readonly ClassName: 'Motor6DSmoothTransformer'; + new ( + getTransform: (below: CFrame) => CFrame | undefined + ): Motor6DSmoothTransformer; +} + +export const Motor6DSmoothTransformer: Motor6DSmoothTransformerConstructor; diff --git a/src/motor6d/src/Shared/Animation/Motor6DTransformer.d.ts b/src/motor6d/src/Shared/Animation/Motor6DTransformer.d.ts new file mode 100644 index 00000000000..fa69e4f158a --- /dev/null +++ b/src/motor6d/src/Shared/Animation/Motor6DTransformer.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Signal } from '@quenty/signal'; + +interface Motor6DTransformer extends BaseObject { + Finished: Signal; + Transform(getBelow: () => CFrame): CFrame | undefined; + FireFinished(): void; +} + +interface Motor6DTransformerConstructor { + readonly ClassName: 'Motor6DTransformer'; + new (): Motor6DTransformer; +} + +export const Motor6DTransformer: Motor6DTransformerConstructor; diff --git a/src/motor6d/src/Shared/Stack/Motor6DStackBase.d.ts b/src/motor6d/src/Shared/Stack/Motor6DStackBase.d.ts new file mode 100644 index 00000000000..176792ff77a --- /dev/null +++ b/src/motor6d/src/Shared/Stack/Motor6DStackBase.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { Motor6DTransformer } from '../Animation/Motor6DTransformer'; + +interface Motor6DStackBase extends BaseObject { + TransformFromCFrame(physicsTransformCFrame: CFrame, speed?: number): void; + Push(transformer: Motor6DTransformer): () => void; +} + +interface Motor6DStackBaseConstructor { + readonly ClassName: 'Motor6DStackBase'; + new (motor6D: Motor6D, serviceBag: ServiceBag): Motor6DStackBase; +} + +export const Motor6DStackBase: Motor6DStackBaseConstructor; diff --git a/src/motor6d/src/Shared/Stack/Motor6DStackInterface.d.ts b/src/motor6d/src/Shared/Stack/Motor6DStackInterface.d.ts new file mode 100644 index 00000000000..bd99c644406 --- /dev/null +++ b/src/motor6d/src/Shared/Stack/Motor6DStackInterface.d.ts @@ -0,0 +1,6 @@ +import { TieDefinition, TieDefinitionMethod } from '@quenty/tie'; + +export const Motor6DStackInterface: TieDefinition<{ + TransformFromCFrame: TieDefinitionMethod; + Push: TieDefinitionMethod; +}>; diff --git a/src/mouseovermixin/index.d.ts b/src/mouseovermixin/index.d.ts new file mode 100644 index 00000000000..04da1bfaeab --- /dev/null +++ b/src/mouseovermixin/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/MouseOverMixin'; diff --git a/src/mouseovermixin/src/Client/MouseOverMixin.d.ts b/src/mouseovermixin/src/Client/MouseOverMixin.d.ts new file mode 100644 index 00000000000..c0d89a0c833 --- /dev/null +++ b/src/mouseovermixin/src/Client/MouseOverMixin.d.ts @@ -0,0 +1,15 @@ +import { Maid } from '@quenty/maid'; + +export interface MouseOverMixin { + GetMouseOverBoolValue( + gui: GuiObject + ): LuaTuple<[maid: Maid, mouseOver: BoolValue]>; + AddMouseOverEffect( + gui: T, + tweenProperties?: Partial> + ): BoolValue; +} + +export const MouseOverMixin: { + Add(classObj: { new (...args: unknown[]): unknown }): void; +}; diff --git a/src/mouseshiftlockservice/index.d.ts b/src/mouseshiftlockservice/index.d.ts new file mode 100644 index 00000000000..6e703f6cdb0 --- /dev/null +++ b/src/mouseshiftlockservice/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/MouseShiftLockService'; diff --git a/src/mouseshiftlockservice/src/Client/MouseShiftLockService.d.ts b/src/mouseshiftlockservice/src/Client/MouseShiftLockService.d.ts new file mode 100644 index 00000000000..33ecda7dab1 --- /dev/null +++ b/src/mouseshiftlockservice/src/Client/MouseShiftLockService.d.ts @@ -0,0 +1,6 @@ +export interface MouseShiftLockService { + readonly ServiceName: 'MouseShiftLockService'; + Init(): void; + EnableShiftLock(): void; + DisableShiftLock(): void; +} diff --git a/src/multipleclickutils/index.d.ts b/src/multipleclickutils/index.d.ts new file mode 100644 index 00000000000..8f109574a64 --- /dev/null +++ b/src/multipleclickutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/MultipleClickUtils'; diff --git a/src/multipleclickutils/src/Client/MultipleClickUtils.d.ts b/src/multipleclickutils/src/Client/MultipleClickUtils.d.ts new file mode 100644 index 00000000000..72b1a1a205b --- /dev/null +++ b/src/multipleclickutils/src/Client/MultipleClickUtils.d.ts @@ -0,0 +1,23 @@ +import { Maid } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +export namespace MultipleClickUtils { + function observeDoubleClick(gui: GuiObject): Observable; + function getDoubleClickSignal( + maid: Maid, + gui: GuiObject + ): Signal; + function observeMultipleClicks( + gui: GuiObject, + requiredCount: number + ): Observable; + function onMultipleClicks( + requiredCount: number + ): (gui: GuiObject) => Observable; + function getMultipleClickSignal( + maid: Maid, + gui: GuiObject, + requiredCount: number + ): Signal; +} diff --git a/src/networkownerservice/index.d.ts b/src/networkownerservice/index.d.ts new file mode 100644 index 00000000000..4e5824e9da2 --- /dev/null +++ b/src/networkownerservice/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/NetworkOwnerService'; diff --git a/src/networkownerservice/src/Server/NetworkOwnerService.d.ts b/src/networkownerservice/src/Server/NetworkOwnerService.d.ts new file mode 100644 index 00000000000..565369ed0e1 --- /dev/null +++ b/src/networkownerservice/src/Server/NetworkOwnerService.d.ts @@ -0,0 +1,8 @@ +export interface NetworkOwnerService { + readonly ServiceName: 'NetworkOwnerService'; + Init(): void; + AddSetNetworkOwnerHandle( + part: BasePart, + player: Player | undefined + ): () => void; +} diff --git a/src/networkownerutils/index.d.ts b/src/networkownerutils/index.d.ts new file mode 100644 index 00000000000..686f0c20c9d --- /dev/null +++ b/src/networkownerutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/NetworkOwnerUtils'; diff --git a/src/networkownerutils/src/Server/NetworkOwnerUtils.d.ts b/src/networkownerutils/src/Server/NetworkOwnerUtils.d.ts new file mode 100644 index 00000000000..aa051866968 --- /dev/null +++ b/src/networkownerutils/src/Server/NetworkOwnerUtils.d.ts @@ -0,0 +1,9 @@ +export namespace NetworkOwnerUtils { + function trySetNetworkOwner(part: BasePart, player?: Player): boolean; + function getNetworkOwnerPlayer(part: BasePart): Player | undefined; + function isNetworkOwner(part: BasePart, player: Player): boolean; + function isServerNetworkOwner(part: BasePart): boolean; + function tryToGetNetworkOwner( + part: BasePart + ): LuaTuple<[success: boolean, player: Player | undefined]>; +} diff --git a/src/networkropeutils/index.d.ts b/src/networkropeutils/index.d.ts new file mode 100644 index 00000000000..c4f56154d73 --- /dev/null +++ b/src/networkropeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/NetworkRopeUtils'; diff --git a/src/networkropeutils/src/Shared/NetworkRopeUtils.d.ts b/src/networkropeutils/src/Shared/NetworkRopeUtils.d.ts new file mode 100644 index 00000000000..7667ee6db1d --- /dev/null +++ b/src/networkropeutils/src/Shared/NetworkRopeUtils.d.ts @@ -0,0 +1,6 @@ +import { Maid } from '@quenty/maid'; + +export namespace NetworkRopeUtils { + function hintSharedMechanism(part0: BasePart, part1: BasePart): Maid; + function clearNetworkOwnerHints(part: BasePart): void; +} diff --git a/src/nocollisionconstraintutils/index.d.ts b/src/nocollisionconstraintutils/index.d.ts new file mode 100644 index 00000000000..1d20bb5ccf6 --- /dev/null +++ b/src/nocollisionconstraintutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/NoCollisionConstraintUtils'; diff --git a/src/nocollisionconstraintutils/src/Shared/NoCollisionConstraintUtils.d.ts b/src/nocollisionconstraintutils/src/Shared/NoCollisionConstraintUtils.d.ts new file mode 100644 index 00000000000..84af934ffc3 --- /dev/null +++ b/src/nocollisionconstraintutils/src/Shared/NoCollisionConstraintUtils.d.ts @@ -0,0 +1,24 @@ +import { Maid } from '@quenty/maid'; + +export namespace NoCollisionConstraintUtils { + function create( + part0: BasePart, + part1: BasePart, + parent?: Instance + ): NoCollisionConstraint; + function tempNoCollision( + parts0: BasePart[], + parts1: BasePart[], + parent?: Instance + ): Maid; + function createBetweenPartsLists( + parts0: BasePart[], + parts1: BasePart[], + parent?: Instance | boolean + ): NoCollisionConstraint[]; + function createBetweenMechanisms( + adornee0: BasePart, + adornee1: BasePart, + parent?: Instance + ): NoCollisionConstraint[]; +} diff --git a/src/numberrangeutils/index.d.ts b/src/numberrangeutils/index.d.ts new file mode 100644 index 00000000000..f1ce30eaded --- /dev/null +++ b/src/numberrangeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/NumberRangeUtils'; diff --git a/src/numberrangeutils/src/Shared/NumberRangeUtils.d.ts b/src/numberrangeutils/src/Shared/NumberRangeUtils.d.ts new file mode 100644 index 00000000000..fb2b4f675ff --- /dev/null +++ b/src/numberrangeutils/src/Shared/NumberRangeUtils.d.ts @@ -0,0 +1,4 @@ +export namespace NumberRangeUtils { + function scale(numberRange: NumberRange, scale: number): NumberRange; + function getValue(numberRange: NumberRange, t: number): number; +} diff --git a/src/numbersequenceutils/index.d.ts b/src/numbersequenceutils/index.d.ts new file mode 100644 index 00000000000..9ed567a49d3 --- /dev/null +++ b/src/numbersequenceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/NumberSequenceUtils'; diff --git a/src/numbersequenceutils/src/Shared/NumberSequenceUtils.d.ts b/src/numbersequenceutils/src/Shared/NumberSequenceUtils.d.ts new file mode 100644 index 00000000000..9a158705e89 --- /dev/null +++ b/src/numbersequenceutils/src/Shared/NumberSequenceUtils.d.ts @@ -0,0 +1,21 @@ +export namespace NumberSequenceUtils { + function getValueGenerator( + numberSequence: NumberSequence + ): (time: number) => number; + function forEachValue( + sequence: NumberSequence, + callback: (value: number) => number + ): NumberSequence; + function scale(sequence: NumberSequence, scale: number): NumberSequence; + function scaleTransparency( + sequence: NumberSequence, + scale: number + ): NumberSequence; + function stripe( + stripes: number, + backgroundTransparency: number, + stripeTransparency: number, + percentStripeThickness: number, + percentOffset: number + ): NumberSequence; +} diff --git a/src/numbertoinputkeyutils/index.d.ts b/src/numbertoinputkeyutils/index.d.ts new file mode 100644 index 00000000000..a8a17b1d812 --- /dev/null +++ b/src/numbertoinputkeyutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/NumberToInputKeyUtils'; diff --git a/src/numbertoinputkeyutils/src/Client/NumberToInputKeyUtils.d.ts b/src/numbertoinputkeyutils/src/Client/NumberToInputKeyUtils.d.ts new file mode 100644 index 00000000000..1dfe34c601b --- /dev/null +++ b/src/numbertoinputkeyutils/src/Client/NumberToInputKeyUtils.d.ts @@ -0,0 +1,5 @@ +export namespace NumberToInputKeyUtils { + function getInputsForNumber(number: number): Enum.KeyCode[] | undefined; + function getNumberFromKeyCode(keyCode: Enum.KeyCode): number | undefined; + function getAllNumberKeyCodes(): Enum.KeyCode[]; +} diff --git a/src/observablecollection/index.d.ts b/src/observablecollection/index.d.ts new file mode 100644 index 00000000000..6cee523125b --- /dev/null +++ b/src/observablecollection/index.d.ts @@ -0,0 +1,11 @@ +export * from './src/Shared/ObservableList'; +export * from './src/Shared/ObservableMap'; +export * from './src/Shared/ObservableCountingMap'; +export * from './src/Shared/ObservableSet'; +export * from './src/Shared/FilteredObservableListView'; +export * from './src/Shared/ObservableMapList'; +export * from './src/Shared/SortedList/ObservableSortedList'; +export * from './src/Shared/SortedList/SortFunctionUtils'; +export * from './src/Shared/SortedList/SortedNode'; +export * from './src/Shared/SortedList/SortedNodeValue'; +export * from './src/Shared/Utils/ListIndexUtils'; diff --git a/src/observablecollection/src/Shared/FilteredObservableListView.d.ts b/src/observablecollection/src/Shared/FilteredObservableListView.d.ts new file mode 100644 index 00000000000..0bfba073690 --- /dev/null +++ b/src/observablecollection/src/Shared/FilteredObservableListView.d.ts @@ -0,0 +1,19 @@ +import { Brio } from '../../../brio'; +import { Observable } from '../../../rx'; +import { Symbol } from '../../../symbol/src/Shared/Symbol'; + +interface FilteredObservableListView { + ObserveItemsBrio(): Observable>; + ObserveIndexByKey(key: Symbol): Observable; + GetCount(): number; + ObserveCount(): Observable; + Destroy(): void; +} + +interface FilteredObservableListViewConstructor { + readonly ClassName: 'FilteredObservableListView'; + new (): FilteredObservableListView; + new (): FilteredObservableListView; +} + +export const FilteredObservableListView: FilteredObservableListViewConstructor; diff --git a/src/observablecollection/src/Shared/ObservableCountingMap.d.ts b/src/observablecollection/src/Shared/ObservableCountingMap.d.ts new file mode 100644 index 00000000000..831539f7457 --- /dev/null +++ b/src/observablecollection/src/Shared/ObservableCountingMap.d.ts @@ -0,0 +1,29 @@ +import { Brio } from '../../../brio'; +import { Observable } from '../../../rx'; + +interface ObservableCountingMap extends Iterable { + ObserveKeysList(): Observable; + ObserveKeysSet(): Observable>; + ObservePairsBrio(): Observable>; + ObserveAtKey(key: T): Observable; + ObserveKeysBrio(): Observable>; + Contains(key: T): boolean; + Get(key: T): number; + GetTotalKeyCount(): number; + ObserveTotalKeyCount(): Observable; + Set(key: T, amount?: number): () => void; + Remove(key: T, amount?: number): () => void; + GetFirstKey(): T | undefined; + GetKeyList(): T[]; + Destroy(): void; +} + +interface ObservableCountingMapConstructor { + readonly ClassName: 'ObservableCountingMap'; + new (): ObservableCountingMap; + new (): ObservableCountingMap; + + isObservableMap(value: unknown): value is ObservableCountingMap; +} + +export const ObservableCountingMap: ObservableCountingMapConstructor; diff --git a/src/observablecollection/src/Shared/ObservableList.d.ts b/src/observablecollection/src/Shared/ObservableList.d.ts new file mode 100644 index 00000000000..fa326078364 --- /dev/null +++ b/src/observablecollection/src/Shared/ObservableList.d.ts @@ -0,0 +1,35 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Symbol } from '@quenty/symbol'; +import { ValueObject } from '@quenty/valueobject'; + +interface ObservableList extends Iterable { + Observe(): Observable; + ObserveItemsBrio(): Observable>; + ObserveIndex(indexToObserve: number): Observable; + ObserveAtIndex(indexToObserve: number): Observable; + ObserveAtIndexBrio(indexToObserve: number): Observable>; + RemoveFirst(item: T): boolean; + GetCountValue(): ValueObject; + ObserveIndexByKey(key: Symbol): Observable; + GetIndexByKey(key: Symbol): number | undefined; + GetCount(): number; + ObserveCount(): Observable; + Add(item: T): () => void; + Get(index: number): T | undefined; + InsertAt(item: T, index: number): () => void; + RemoveAt(index: number): T | undefined; + RemoveByKey(key: Symbol): T | undefined; + GetList(): T[]; + Destroy(): void; +} + +interface ObservableListConstructor { + readonly ClassName: 'ObservableList'; + new (): ObservableList; + new (): ObservableList; + + isObservableList(value: unknown): value is ObservableList; +} + +export const ObservableList: ObservableListConstructor; diff --git a/src/observablecollection/src/Shared/ObservableMap.d.ts b/src/observablecollection/src/Shared/ObservableMap.d.ts new file mode 100644 index 00000000000..f7f58e75c2b --- /dev/null +++ b/src/observablecollection/src/Shared/ObservableMap.d.ts @@ -0,0 +1,33 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +type ObservableMap = { + CountChanged: Signal; + ObserveKeysBrio(): Observable>; + ObserveValuesBrio(): Observable>; + ObservePairsBrio(): Observable>; + Get(key: TKey): TValue | undefined; + ContainsKey(key: TKey): boolean; + GetCount(): number; + ObserveCount(): Observable; + ObserveAtKeyBrio(key: TKey): Observable>; + ObserveAtKey(key: TKey): Observable; + ObserveValueForKey(key: TKey): Observable; + Set(key: TKey, value?: TValue): () => void; + Remove(key: TKey): void; + GetValueList(): TValue[]; + GetKeyList(): TKey[]; + ObserveKeyList(): Observable; + Destroy(): void; +} & IterableFunction>; + +interface ObservableMapConstructor { + readonly ClassName: 'ObservableMap'; + new (): ObservableMap; + new (): ObservableMap; + + isObservableMap(value: unknown): value is ObservableMap; +} + +export const ObservableMap: ObservableMapConstructor; diff --git a/src/observablecollection/src/Shared/ObservableMapList.d.ts b/src/observablecollection/src/Shared/ObservableMapList.d.ts new file mode 100644 index 00000000000..69b08167b6f --- /dev/null +++ b/src/observablecollection/src/Shared/ObservableMapList.d.ts @@ -0,0 +1,43 @@ +import { Brio } from '@quenty/brio'; +import { Maid } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { ObservableList } from './ObservableList'; + +interface ObservableMapList { + ListAdded: Signal<[key: TKey, list: ObservableList]>; + ListRemoved: Signal; + CountChanged: Signal; + Push(key: TKey | Observable, entry: TValue): Maid; + GetFirstItemForKey(key: TKey): TValue | undefined; + GetItemForKeyAtIndex(key: TKey, index: number): TValue | undefined; + GetListCount(): number; + ObserveListCount(): Observable; + GetKeyList(): TKey[]; + ObserveKeyList(): Observable; + ObserveKeysBrio(): Observable>; + GetAtListIndex(key: TKey, index: number): TValue | undefined; + ObserveAtListIndex(key: TKey, index: number): Observable; + ObserveAtListIndexBrio(key: TKey, index: number): Observable>; + ObserveItemsForKeyBrio(key: TKey): Observable>; + GetListFromKey(key: TKey): TValue[]; + GetListForKey(key: TKey): ObservableList; + GetListOfValuesAtListIndex(index: number): TValue[]; + ObserveList(key: TKey): Observable>; + ObserveListBrio(key: TKey): Observable>>; + ObserveListsBrio(): Observable>>; + ObserveCountForKey(key: TKey): Observable; + Destroy(): void; +} + +interface ObservableMapListConstructor { + readonly ClassName: 'ObservableMapList'; + new (): ObservableMapList; + new (): ObservableMapList; + + isObservableMapList( + value: unknown + ): value is ObservableMapList; +} + +export const ObservableMapList: ObservableMapListConstructor; diff --git a/src/observablecollection/src/Shared/ObservableSet.d.ts b/src/observablecollection/src/Shared/ObservableSet.d.ts new file mode 100644 index 00000000000..ee334a54e3c --- /dev/null +++ b/src/observablecollection/src/Shared/ObservableSet.d.ts @@ -0,0 +1,31 @@ +import { Signal } from '@quenty/signal'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +type ObservableSet = { + ItemAdded: Signal; + ItemRemoved: Signal; + CountChanged: Signal; + ObserveItemsBrio(): Observable>; + ObserveContains(item: T): Observable; + Contains(item: T): boolean; + GetCount(): number; + ObserveCount(): Observable; + Add(item: T): () => void; + Remove(item: T): void; + GetFirstItem(): T | undefined; + GetList(): T[]; + GetSetCopy(): Map; + GetRawSet(): ReadonlyMap; + Destroy(): void; +} & IterableFunction; + +interface ObservableSetConstructor { + readonly ClassName: 'ObservableSet'; + new (): ObservableSet; + new (): ObservableSet; + + isObservableSet(value: unknown): value is ObservableSet; +} + +export const ObservableSet: ObservableSetConstructor; diff --git a/src/observablecollection/src/Shared/SortedList/ObservableSortedList.d.ts b/src/observablecollection/src/Shared/SortedList/ObservableSortedList.d.ts new file mode 100644 index 00000000000..d38597648fb --- /dev/null +++ b/src/observablecollection/src/Shared/SortedList/ObservableSortedList.d.ts @@ -0,0 +1,46 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; +import { Symbol } from '@quenty/symbol'; +import { SortedNode } from './SortedNode'; + +interface ObservableSortedList extends Iterable { + ItemAdded: Signal>; + ItemRemoved: Signal>; + OrderChanged: Signal; + CountChanged: Signal; + Observe(): Observable; + IterateRange(start: number, finish: number): Iterable; + FindFirstKey(item: T): SortedNode | undefined; + PrintDebug(): void; + Contains(item: T): boolean; + ObserveItemsBrio(): Observable< + Brio]>> + >; + ObserveIndex(indexToObserve: number): Observable; + ObserveAtIndex( + indexToObserve: number + ): Observable]>>; + ObserveIndexByKey(node: SortedNode): Observable; + GetIndexByKey(node: SortedNode): number | undefined; + GetCount(): number; + __len(): number; + GetList(): T[]; + ObserveCount(): Observable; + Add(item: T, observeValue: Observable | number): () => void; + Get(index: number): T | undefined; + RemoveByKey(node: SortedNode): void; + Destroy(): void; +} + +interface ObservableSortedListConstructor { + readonly ClassName: 'ObservableSortedList'; + new (): ObservableSortedList; + new (): ObservableSortedList; + + isObservableSortedList( + value: unknown + ): value is ObservableSortedList; +} + +export const ObservableSortedList: ObservableSortedListConstructor; diff --git a/src/observablecollection/src/Shared/SortedList/SortFunctionUtils.d.ts b/src/observablecollection/src/Shared/SortedList/SortFunctionUtils.d.ts new file mode 100644 index 00000000000..d7ed97097ed --- /dev/null +++ b/src/observablecollection/src/Shared/SortedList/SortFunctionUtils.d.ts @@ -0,0 +1,8 @@ +type SortFunction = (a: T, b: T) => number; + +export namespace SortFunctionUtils { + function reverse(compare?: SortFunction): SortFunction; + // cant use `default` as a function name because it is a reserved keyword + // function default(a: unknown, b: unknown): number; + function emptyIterator(): void; +} diff --git a/src/observablecollection/src/Shared/SortedList/SortedNode.d.ts b/src/observablecollection/src/Shared/SortedList/SortedNode.d.ts new file mode 100644 index 00000000000..f39d68e3797 --- /dev/null +++ b/src/observablecollection/src/Shared/SortedList/SortedNode.d.ts @@ -0,0 +1,29 @@ +type CompareFunction = (a: T, b: T) => number; +type WrappedIterator = (...values: unknown[]) => T[]; + +interface SortedNode extends Iterable { + IterateNodes(): WrappedIterator<[number, SortedNode]>; + IterateData(): WrappedIterator<[number, T]>; + IterateNodesRange( + start: number, + finish?: number + ): WrappedIterator<[number, SortedNode]>; + FindNodeAtIndex(searchIndex: number): SortedNode | undefined; + FindNodeIndex(node: SortedNode): number | undefined; + GetIndex(): number; + FindFirstNodeForData(data: T): SortedNode | undefined; + NeedsToMove(root: SortedNode | undefined, newValue: number): boolean; + ContainsNode(node: SortedNode): boolean; + MarkBlack(): void; + InsertNode(node: SortedNode): SortedNode; + RemoveNode(node: SortedNode): SortedNode; +} + +interface SortedNodeConstructor { + readonly ClassName: 'SortedNode'; + new (data: T): SortedNode; + + isSortedNode(value: unknown): value is SortedNode; +} + +export const SortedNode: SortedNodeConstructor; diff --git a/src/observablecollection/src/Shared/SortedList/SortedNodeValue.d.ts b/src/observablecollection/src/Shared/SortedList/SortedNodeValue.d.ts new file mode 100644 index 00000000000..558c0472bea --- /dev/null +++ b/src/observablecollection/src/Shared/SortedList/SortedNodeValue.d.ts @@ -0,0 +1,18 @@ +import { CompareFunction } from './SortedNode'; + +interface SortedNodeValue extends Iterable { + GetValue(): T; + __eq(other: SortedNodeValue): boolean; + __lt(other: SortedNodeValue): boolean; + __gt(other: SortedNodeValue): boolean; +} + +interface SortedNodeValueConstructor { + readonly ClassName: 'SortedNodeValue'; + new (): SortedNodeValue; + new (value: T, compare: CompareFunction): SortedNodeValue; + + isSortedNodeValue(value: unknown): value is SortedNodeValue; +} + +export const SortedNodeValue: SortedNodeValueConstructor; diff --git a/src/observablecollection/src/Shared/Utils/ListIndexUtils.d.ts b/src/observablecollection/src/Shared/Utils/ListIndexUtils.d.ts new file mode 100644 index 00000000000..ae31774ed5e --- /dev/null +++ b/src/observablecollection/src/Shared/Utils/ListIndexUtils.d.ts @@ -0,0 +1,4 @@ +export namespace ListIndexUtils { + function toPositiveIndex(listLength: number, index: number): number; + function toNegativeIndex(listLength: number, index: number): number; +} diff --git a/src/octree/index.d.ts b/src/octree/index.d.ts new file mode 100644 index 00000000000..6592ef2b515 --- /dev/null +++ b/src/octree/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/Octree'; +export * from './src/Shared/OctreeNode'; +export * from './src/Shared/OctreeRegionUtils'; diff --git a/src/octree/src/Shared/Octree.d.ts b/src/octree/src/Shared/Octree.d.ts new file mode 100644 index 00000000000..bddd6c5fbab --- /dev/null +++ b/src/octree/src/Shared/Octree.d.ts @@ -0,0 +1,28 @@ +import { OctreeNode } from './OctreeNode'; +import { OctreeRegion } from './OctreeRegionUtils'; + +interface Octree { + GetAllNodes(): OctreeNode[]; + CreateNode(position: Vector3, object: T): OctreeNode; + RadiusSearch( + position: Vector3, + radius: number + ): LuaTuple<[objects: T[], distancesSquared: number[]]>; + KNearestNeighborsSearch( + position: Vector3, + k: number, + radius: number + ): LuaTuple<[objects: T[], distancesSquared: number[]]>; + GetOrCreateLowestSubRegion( + px: number, + py: number, + pz: number + ): OctreeRegion; +} + +interface OctreeConstructor { + readonly ClassName: 'Octree'; + new (): Octree; +} + +export const Octree: OctreeConstructor; diff --git a/src/octree/src/Shared/OctreeNode.d.ts b/src/octree/src/Shared/OctreeNode.d.ts new file mode 100644 index 00000000000..38abe02612d --- /dev/null +++ b/src/octree/src/Shared/OctreeNode.d.ts @@ -0,0 +1,25 @@ +import { Octree } from './Octree'; + +interface OctreeNode { + KNearestNeighborsSearch( + k: number, + radius: number + ): LuaTuple<[objects: T[], distancesSquared: number[]]>; + GetObject(): T; + RadiusSearch( + radius: number + ): LuaTuple<[objects: T[], distancesSquared: number[]]>; + GetPosition(): Vector3 | undefined; + GetRawPosition(): LuaTuple< + [px: number | undefined, py: number | undefined, pz: number | undefined] + >; + SetPosition(position: Vector3): void; + Destroy(): void; +} + +interface OctreeNodeConstructor { + readonly ClassName: 'OctreeNode'; + new (octree: Octree, object: T): OctreeNode; +} + +export const OctreeNode: OctreeNodeConstructor; diff --git a/src/octree/src/Shared/OctreeRegionUtils.d.ts b/src/octree/src/Shared/OctreeRegionUtils.d.ts new file mode 100644 index 00000000000..530a29b2b9f --- /dev/null +++ b/src/octree/src/Shared/OctreeRegionUtils.d.ts @@ -0,0 +1,116 @@ +import { OctreeNode } from './OctreeNode'; + +type OctreeVector3 = [px: number, py: number, pz: number]; + +type OctreeRegionHashMap = { [key: number]: OctreeRegion[] }; + +export interface OctreeRegion { + subRegions: OctreeRegion[]; + lowerBounds: OctreeVector3; + upperBounds: OctreeVector3; + position: OctreeVector3; + size: OctreeVector3; + parent: OctreeRegion | undefined; + parentIndex: number | undefined; + depth: number; + nodes: Map, OctreeNode>; + node_count: number; +} + +export namespace OctreeRegionUtils { + function visualize(region: OctreeRegion): Instance; + function create( + px: number, + py: number, + pz: number, + sx: number, + sy: number, + sz: number, + parent?: OctreeRegion, + parentIndex?: number + ): OctreeRegion; + function addNode( + lowestSubregion: OctreeRegion, + node: OctreeNode + ): void; + function modeNode( + fromLowest: OctreeRegion, + toLowest: OctreeRegion, + node: OctreeNode + ): void; + function removeNode( + lowestSubregion: OctreeRegion, + node: OctreeNode + ): void; + function getSearchRadiusSquared( + radius: number, + diameter: number, + epsilon: number + ): number; + function getNeighborsWithinRadius( + region: OctreeRegion, + radius: number, + px: number, + py: number, + pz: number, + objectsFound: T[], + nodeDistances2: number[], + maxDepth: number + ): void; + function getOrCreateSubRegionAtDepth( + region: OctreeRegion, + px: number, + py: number, + pz: number, + maxDepth: number + ): OctreeRegion; + function createSubRegion( + parentRegion: OctreeRegion, + parentIndex: number + ): OctreeRegion; + function inRegionBounds( + region: OctreeRegion, + px: number, + py: number, + pz: number + ): boolean; + function getSubRegionIndex( + region: OctreeRegion, + px: number, + py: number, + pz: number + ): number; + function getTopLevelRegionHash(cx: number, cy: number, cz: number): number; + function getTopLevelRegionCellIndex( + maxRegionSize: OctreeVector3, + px: number, + py: number, + pz: number + ): LuaTuple<[rpx: number, rpy: number, rpz: number]>; + function getTopLevelRegionPosition( + maxRegionSize: OctreeVector3, + cx: number, + cy: number, + cz: number + ): LuaTuple<[number, number, number]>; + function areEqualTopRegions( + region: OctreeRegion, + rpx: number, + rpy: number, + rpz: number + ): boolean; + function findRegion( + regionHashMap: OctreeRegionHashMap, + maxRegionSize: OctreeVector3, + px: number, + py: number, + pz: number + ): OctreeRegion | undefined; + function getOrCreateRegion( + regionHashMap: OctreeRegionHashMap, + maxRegionSize: OctreeVector3, + px: number, + py: number, + pz: number + ): OctreeRegion; +} diff --git a/src/optional/index.d.ts b/src/optional/index.d.ts new file mode 100644 index 00000000000..347b34cf5d9 --- /dev/null +++ b/src/optional/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/optional'; diff --git a/src/optional/src/Shared/optional.d.ts b/src/optional/src/Shared/optional.d.ts new file mode 100644 index 00000000000..13a9cd95383 --- /dev/null +++ b/src/optional/src/Shared/optional.d.ts @@ -0,0 +1,4 @@ +export const optional: ( + _require: typeof require, + _module: string | number | ModuleScript +) => T | undefined; diff --git a/src/overriddenproperty/index.d.ts b/src/overriddenproperty/index.d.ts new file mode 100644 index 00000000000..5aa93c17211 --- /dev/null +++ b/src/overriddenproperty/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/OverriddenProperty'; diff --git a/src/overriddenproperty/src/Shared/OverriddenProperty.d.ts b/src/overriddenproperty/src/Shared/OverriddenProperty.d.ts new file mode 100644 index 00000000000..49679bc7a19 --- /dev/null +++ b/src/overriddenproperty/src/Shared/OverriddenProperty.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface OverriddenProperty extends BaseObject { + Set(value: V): void; + Get(): V; +} + +interface OverriddenPropertyConstructor { + readonly ClassName: 'OverriddenProperty'; + new >( + instance: T, + propertyName: V + ): OverriddenProperty; + new >( + instance: Instance, + propertyName: string, + replicateRate: number, + replicateCallback: () => void + ): OverriddenProperty; +} + +export const OverriddenProperty: OverriddenPropertyConstructor; diff --git a/src/pagesutils/index.d.ts b/src/pagesutils/index.d.ts new file mode 100644 index 00000000000..2466802526b --- /dev/null +++ b/src/pagesutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/PagesUtils'; +export * from './src/Shared/Proxy/PagesDatabase'; +export * from './src/Shared/Proxy/PagesProxy'; diff --git a/src/pagesutils/src/Shared/PagesUtils.d.ts b/src/pagesutils/src/Shared/PagesUtils.d.ts new file mode 100644 index 00000000000..f9c672d569a --- /dev/null +++ b/src/pagesutils/src/Shared/PagesUtils.d.ts @@ -0,0 +1,5 @@ +export namespace PagesUtils { + function promiseAdvanceTonextPage( + pages: T + ): Promise ? U[] : unknown[]>; +} diff --git a/src/pagesutils/src/Shared/Proxy/PagesDatabase.d.ts b/src/pagesutils/src/Shared/Proxy/PagesDatabase.d.ts new file mode 100644 index 00000000000..69655dc2571 --- /dev/null +++ b/src/pagesutils/src/Shared/Proxy/PagesDatabase.d.ts @@ -0,0 +1,14 @@ +interface PagesDatabase { + IncrementToPageIdAsync(pageId: number): void; + GetPage(pageId: number): T extends Pages ? U[] : unknown[]; + GetIsFinished(pageId: number): boolean; +} + +interface PagesDatabaseConstructor { + readonly ClassName: 'PagesDatabase'; + new (pages: T): PagesDatabase; + + isPagesDatabase: (value: unknown) => value is PagesDatabase; +} + +export const PagesDatabase: PagesDatabaseConstructor; diff --git a/src/pagesutils/src/Shared/Proxy/PagesProxy.d.ts b/src/pagesutils/src/Shared/Proxy/PagesProxy.d.ts new file mode 100644 index 00000000000..0743f80b27b --- /dev/null +++ b/src/pagesutils/src/Shared/Proxy/PagesProxy.d.ts @@ -0,0 +1,21 @@ +import { PagesDatabase } from './PagesDatabase'; + +interface PagesProxy> { + readonly IsFinished: boolean; + AdvanceToNextPageAsync(): void; + GetCurrentPage(): T extends PagesDatabase + ? U[] + : T extends Pages + ? U[] + : unknown[]; + Clone(): PagesProxy; +} + +interface PagesProxyConstructor { + readonly ClassName: 'PagesProxy'; + new >(database: T): PagesProxy; + + isPagesProxy: (value: unknown) => value is PagesProxy>; +} + +export const PagesProxy: PagesProxyConstructor; diff --git a/src/particleengine/index.d.ts b/src/particleengine/index.d.ts new file mode 100644 index 00000000000..d8a99745385 --- /dev/null +++ b/src/particleengine/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Client/ParticleEngineClient'; +export * from './src/Server/ParticleEngineServer'; +export * from './src/Shared/ParticleEngineConstants'; diff --git a/src/particleengine/src/Client/ParticleEngineClient.d.ts b/src/particleengine/src/Client/ParticleEngineClient.d.ts new file mode 100644 index 00000000000..ad0efb313dd --- /dev/null +++ b/src/particleengine/src/Client/ParticleEngineClient.d.ts @@ -0,0 +1,31 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface Particle { + Position: Vector3; + Global: boolean; + Velocity: Vector3; + Gravity: Vector3; + WindResistance: number; + LifeTime: number; + Size: Vector2; + Bloom: Vector2; + Transparency: number; + Color: Color3; + Occlusion?: boolean; + RemoveOnCollision?: ( + particle: Particle, + hit: BasePart, + position: Vector3, + normal: Vector3, + material: Enum.Material + ) => boolean; + Function?: (particle: Particle, dt: number, t: number) => void; +} + +export interface ParticleEngineClient { + readonly ServiceName: 'ParticleEngineClient'; + Init(serviceBag: ServiceBag): void; + SetScreenGui(screenGui: ScreenGui): void; + Remove(particle: Particle): void; + Add(particle: Particle): void; +} diff --git a/src/particleengine/src/Server/ParticleEngineServer.d.ts b/src/particleengine/src/Server/ParticleEngineServer.d.ts new file mode 100644 index 00000000000..a76a6635624 --- /dev/null +++ b/src/particleengine/src/Server/ParticleEngineServer.d.ts @@ -0,0 +1,18 @@ +export interface ParticleEngineServer { + readonly ServiceName: 'ParticleEngineServer'; + Init(): void; + ParticleNew< + T extends { + Position: Vector3; + Velocity?: Vector3; + Size?: Vector2; + Bloom?: Vector2; + Gravity?: Vector3; + LifeTime: number; + Color?: Color3; + Transparency?: number; + } + >( + p: T + ): T; +} diff --git a/src/particleengine/src/Shared/ParticleEngineConstants.d.ts b/src/particleengine/src/Shared/ParticleEngineConstants.d.ts new file mode 100644 index 00000000000..7b9359be7d2 --- /dev/null +++ b/src/particleengine/src/Shared/ParticleEngineConstants.d.ts @@ -0,0 +1,3 @@ +export const ParticleEngineConstants: Readonly<{ + REMOTE_EVENT_NAME: 'ParticleEventDistributor'; +}>; diff --git a/src/particles/index.d.ts b/src/particles/index.d.ts new file mode 100644 index 00000000000..b2938623aa3 --- /dev/null +++ b/src/particles/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ParticleEmitterUtils'; diff --git a/src/particles/src/Shared/ParticleEmitterUtils.d.ts b/src/particles/src/Shared/ParticleEmitterUtils.d.ts new file mode 100644 index 00000000000..f6bda3a334d --- /dev/null +++ b/src/particles/src/Shared/ParticleEmitterUtils.d.ts @@ -0,0 +1,7 @@ +import { Maid } from '@quenty/maid'; + +export namespace ParticleEmitterUtils { + function scaleSize(adornee: Instance, scale: number): void; + function playFromTemplate(template: Instance, attachment: Attachment): Maid; + function getParticleEmitters(adornee: Instance): ParticleEmitter[]; +} diff --git a/src/parttouchingcalculator/index.d.ts b/src/parttouchingcalculator/index.d.ts new file mode 100644 index 00000000000..b4567bdccb3 --- /dev/null +++ b/src/parttouchingcalculator/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/BinderTouchingCalculator'; +export * from './src/Shared/PartTouchingCalculator'; +export * from './src/Shared/PartTouchingRenderer'; diff --git a/src/parttouchingcalculator/src/Shared/BinderTouchingCalculator.d.ts b/src/parttouchingcalculator/src/Shared/BinderTouchingCalculator.d.ts new file mode 100644 index 00000000000..be97130ed17 --- /dev/null +++ b/src/parttouchingcalculator/src/Shared/BinderTouchingCalculator.d.ts @@ -0,0 +1,20 @@ +import { Binder } from '@quenty/binder'; +import { PartTouchingCalculator } from './PartTouchingCalculator'; + +interface BinderTouchingCalculator extends PartTouchingCalculator { + GetTouchingClass( + binder: Binder, + touchingList: BasePart[], + ignoreObject?: Instance + ): { + Object: T; + Touching: BasePart[]; + }[]; +} + +interface BinderTouchingCalculatorConstructor { + readonly ClassName: 'BinderTouchingCalculator'; + new (): BinderTouchingCalculator; +} + +export const BinderTouchingCalculator: BinderTouchingCalculatorConstructor; diff --git a/src/parttouchingcalculator/src/Shared/PartTouchingCalculator.d.ts b/src/parttouchingcalculator/src/Shared/PartTouchingCalculator.d.ts new file mode 100644 index 00000000000..9e09cc7bf6a --- /dev/null +++ b/src/parttouchingcalculator/src/Shared/PartTouchingCalculator.d.ts @@ -0,0 +1,28 @@ +interface PartTouchingCalculator { + CheckIfTouchingHumanoid(humanoid: Humanoid, parts: BasePart[]): boolean; + GetCollidingPartFromParts( + parts: BasePart[], + relativeTo?: CFrame, + padding?: number + ): BasePart; + GetTouchingBoundingBox( + parts: BasePart[], + relativeTo?: CFrame, + padding?: number + ): BasePart[]; + GetTouchingHull(parts: BasePart[], padding?: number): BasePart[]; + GetTouching(basePart: BasePart, padding?: number): BasePart[]; + GetTouchingHumanoids(touchingList: BasePart[]): { + Humanoid: Humanoid; + Character?: Model; + Player?: Player; + Touching: BasePart[]; + }[]; +} + +interface PartTouchingCalculatorConstructor { + readonly ClassName: 'PartTouchingCalculator'; + new (): PartTouchingCalculator; +} + +export const PartTouchingCalculator: PartTouchingCalculatorConstructor; diff --git a/src/parttouchingcalculator/src/Shared/PartTouchingRenderer.d.ts b/src/parttouchingcalculator/src/Shared/PartTouchingRenderer.d.ts new file mode 100644 index 00000000000..410bdcfacde --- /dev/null +++ b/src/parttouchingcalculator/src/Shared/PartTouchingRenderer.d.ts @@ -0,0 +1,10 @@ +interface PartTouchingRenderer { + RenderTouchingProps(touchingPartList: BasePart[]): void; +} + +interface PartTouchingRendererConstructor { + readonly ClassName: 'PartTouchingRenderer'; + new (): PartTouchingRenderer; +} + +export const PartTouchingRenderer: PartTouchingRendererConstructor; diff --git a/src/pathfindingutils/index.d.ts b/src/pathfindingutils/index.d.ts new file mode 100644 index 00000000000..9a015b31290 --- /dev/null +++ b/src/pathfindingutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PathfindingUtils'; diff --git a/src/pathfindingutils/src/Shared/PathfindingUtils.d.ts b/src/pathfindingutils/src/Shared/PathfindingUtils.d.ts new file mode 100644 index 00000000000..88db83ec00c --- /dev/null +++ b/src/pathfindingutils/src/Shared/PathfindingUtils.d.ts @@ -0,0 +1,15 @@ +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +export namespace PathfindingUtils { + function promiseComputeAsync( + path: Path, + start: Vector3, + finish: Vector3 + ): Promise; + function promiseCheckOcclusion( + path: Path, + startIndex: number + ): Promise; + function visualizePath(path: Path): Maid; +} diff --git a/src/performanceutils/index.d.ts b/src/performanceutils/index.d.ts new file mode 100644 index 00000000000..298639af786 --- /dev/null +++ b/src/performanceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PerformanceUtils'; diff --git a/src/performanceutils/src/Shared/PerformanceUtils.d.ts b/src/performanceutils/src/Shared/PerformanceUtils.d.ts new file mode 100644 index 00000000000..44f1fb985a4 --- /dev/null +++ b/src/performanceutils/src/Shared/PerformanceUtils.d.ts @@ -0,0 +1,24 @@ +interface CounterData { + total: number; + formatter: (value: number) => string; +} + +export namespace PerformanceUtils { + function profileTimeBegin(label: string): () => void; + function profileTimeEnd(): void; + function incrementCounter(label: string, amount?: number): void; + function readCounter(label: string): number; + function getOrCreateCounter(label: string): CounterData; + function setLabelFormat( + label: string, + formatter: (value: number) => string + ): void; + function formatAsMilliseconds(value: number): string; + function formatAsCalls(value: number): string; + function countCalls(label: string, object: T, method: keyof T): void; + function countLibraryCalls(prefix: string, library: unknown): void; + function countCallTime(label: string, object: T, method: keyof T): void; + function countObject(label: string, object: unknown): void; + function trackObjectConstruction(object: unknown): void; + function printAll(): void; +} diff --git a/src/permissionprovider/index.d.ts b/src/permissionprovider/index.d.ts new file mode 100644 index 00000000000..540d5991faa --- /dev/null +++ b/src/permissionprovider/index.d.ts @@ -0,0 +1,10 @@ +export * from './src/Client/PermissionServiceClient'; +export * from './src/Client/Providers/PermissionProviderClient'; +export * from './src/Server/PermissionProviderUtils'; +export * from './src/Server/PermissionService'; +export * from './src/Server/Providers/BasePermissionProvider'; +export * from './src/Server/Providers/CreatorPermissionProvider'; +export * from './src/Server/Providers/GroupPermissionProvider'; +export * from './src/Shared/PermissionLevel'; +export * from './src/Shared/PermissionLevelUtils'; +export * from './src/Shared/PermissionProviderConstants'; diff --git a/src/permissionprovider/package.json b/src/permissionprovider/package.json index 31b6d0e2d6c..3b64c1a4394 100644 --- a/src/permissionprovider/package.json +++ b/src/permissionprovider/package.json @@ -39,7 +39,8 @@ "@quenty/remoting": "workspace:*", "@quenty/rx": "workspace:*", "@quenty/servicebag": "workspace:*", - "@quenty/table": "workspace:*" + "@quenty/table": "workspace:*", + "@quenty/simpleenum": "workspace:*" }, "publishConfig": { "access": "public" diff --git a/src/permissionprovider/src/Client/PermissionServiceClient.d.ts b/src/permissionprovider/src/Client/PermissionServiceClient.d.ts new file mode 100644 index 00000000000..465ee54f718 --- /dev/null +++ b/src/permissionprovider/src/Client/PermissionServiceClient.d.ts @@ -0,0 +1,11 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; +import { PermissionProviderClient } from './Providers/PermissionProviderClient'; + +export interface PermissionServiceClient { + readonly ServiceName: 'PermissionServiceClient'; + Init(serviceBag: ServiceBag): void; + PromiseIsAdmin(): Promise; + PromisePermissionProvider(): Promise; + Destroy(): void; +} diff --git a/src/permissionprovider/src/Client/Providers/PermissionProviderClient.d.ts b/src/permissionprovider/src/Client/Providers/PermissionProviderClient.d.ts new file mode 100644 index 00000000000..e0b501bd3a8 --- /dev/null +++ b/src/permissionprovider/src/Client/Providers/PermissionProviderClient.d.ts @@ -0,0 +1,12 @@ +import { Promise } from '@quenty/promise'; + +interface PermissionProviderClient { + PromiseIsAdmin(): Promise; +} + +interface PermissionProviderClientConstructor { + readonly ClassName: 'PermissionProviderClient'; + new (remoteFunctionName: string): PermissionProviderClient; +} + +export const PermissionProviderClient: PermissionProviderClientConstructor; diff --git a/src/permissionprovider/src/Server/PermissionProviderUtils.d.ts b/src/permissionprovider/src/Server/PermissionProviderUtils.d.ts new file mode 100644 index 00000000000..b2040998533 --- /dev/null +++ b/src/permissionprovider/src/Server/PermissionProviderUtils.d.ts @@ -0,0 +1,29 @@ +export interface GroupRankConfigInput { + groupId: number; + minAdminRequiredRank: number; + minCreatorRequiredRank: number; + remoteFunctionName: string; +} + +export interface GroupRankConfig extends GroupRankConfigInput { + type: 'GroupRankConfigType'; +} + +export interface SingleUserConfigInput { + userId: number; + remoteFunctionName: string; +} + +export interface SingleUserConfig extends SingleUserConfigInput { + type: 'SingleUserConfigType'; +} + +export type PermissionProviderConfig = GroupRankConfig | SingleUserConfig; + +export namespace PermissionProviderUtils { + function createGroupRankConfig(config: GroupRankConfigInput): GroupRankConfig; + function createSingleUserConfig( + config: SingleUserConfigInput + ): SingleUserConfig; + function createConfigFromGame(): PermissionProviderConfig; +} diff --git a/src/permissionprovider/src/Server/PermissionService.d.ts b/src/permissionprovider/src/Server/PermissionService.d.ts new file mode 100644 index 00000000000..90fea5449db --- /dev/null +++ b/src/permissionprovider/src/Server/PermissionService.d.ts @@ -0,0 +1,25 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PermissionProviderConfig } from './PermissionProviderUtils'; +import { Promise } from '@quenty/promise'; +import { BasePermissionProvider } from './Providers/BasePermissionProvider'; +import { PermissionLevel } from '../Shared/PermissionLevel'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export interface PermissionService { + readonly ServiceName: 'PermissionService'; + Init(serviceBag: ServiceBag): void; + SetProviderFromConfig(config: PermissionProviderConfig): void; + Start(): void; + PromisePermissionProvider(): Promise; + PromiseIsAdmin(player: Player): Promise; + PromiseIsCreator(player: Player): Promise; + PromiseIsPermissionLevel( + player: Player, + permissionLevel: PermissionLevel + ): Promise; + ObservePermissionedPlayersBrio( + permissionLevel: PermissionLevel + ): Observable>; + Destroy(): void; +} diff --git a/src/permissionprovider/src/Server/Providers/BasePermissionProvider.d.ts b/src/permissionprovider/src/Server/Providers/BasePermissionProvider.d.ts new file mode 100644 index 00000000000..a29b254b10e --- /dev/null +++ b/src/permissionprovider/src/Server/Providers/BasePermissionProvider.d.ts @@ -0,0 +1,24 @@ +import { BaseObject } from '@quenty/baseobject'; +import { PermissionProviderConfig } from '../PermissionProviderUtils'; +import { PermissionLevel } from '../../Shared/PermissionLevel'; +import { Promise } from '@quenty/promise'; + +interface BasePermissionProvider extends BaseObject { + Start(): void; + PromiseIsPermissionLevel( + player: Player, + permissionLevel: PermissionLevel + ): Promise; + IsPermissionLevel(player: Player, permissionLevel: PermissionLevel): boolean; + PromiseIsCreator(player: Player): Promise; + PromiseIsAdmin(player: Player): Promise; + IsCreator(player: Player): boolean; + IsAdmin(player: Player): boolean; +} + +interface BasePermissionProviderConstructor { + readonly ClassName: 'BasePermissionProvider'; + new (config: PermissionProviderConfig): BasePermissionProvider; +} + +export const BasePermissionProvider: BasePermissionProviderConstructor; diff --git a/src/permissionprovider/src/Server/Providers/CreatorPermissionProvider.d.ts b/src/permissionprovider/src/Server/Providers/CreatorPermissionProvider.d.ts new file mode 100644 index 00000000000..909265425f6 --- /dev/null +++ b/src/permissionprovider/src/Server/Providers/CreatorPermissionProvider.d.ts @@ -0,0 +1,11 @@ +import { SingleUserConfig } from '../PermissionProviderUtils'; +import { BasePermissionProvider } from './BasePermissionProvider'; + +interface CreatorPermissionProvider extends BasePermissionProvider {} + +interface CreatorPermissionProviderConstructor { + readonly ClassName: 'CreatorPermissionProvider'; + new (config: SingleUserConfig): CreatorPermissionProvider; +} + +export const CreatorPermissionProvider: CreatorPermissionProviderConstructor; diff --git a/src/permissionprovider/src/Server/Providers/GroupPermissionProvider.d.ts b/src/permissionprovider/src/Server/Providers/GroupPermissionProvider.d.ts new file mode 100644 index 00000000000..aab36ff0de9 --- /dev/null +++ b/src/permissionprovider/src/Server/Providers/GroupPermissionProvider.d.ts @@ -0,0 +1,11 @@ +import { GroupRankConfig } from '../PermissionProviderUtils'; +import { BasePermissionProvider } from './BasePermissionProvider'; + +interface GroupPermissionProvider extends BasePermissionProvider {} + +interface GroupPermissionProviderConstructor { + readonly ClassName: 'GroupPermissionProvider'; + new (config: GroupRankConfig): GroupPermissionProvider; +} + +export const GroupPermissionProvider: GroupPermissionProviderConstructor; diff --git a/src/permissionprovider/src/Shared/PermissionLevel.d.ts b/src/permissionprovider/src/Shared/PermissionLevel.d.ts new file mode 100644 index 00000000000..2ce3c10dda4 --- /dev/null +++ b/src/permissionprovider/src/Shared/PermissionLevel.d.ts @@ -0,0 +1,9 @@ +import { SimpleEnum } from '@quenty/enums'; + +export type PermissionLevel = + (typeof PermissionLevel)[keyof typeof PermissionLevel]; + +export const PermissionLevel: SimpleEnum<{ + ADMIN: 'admin'; + CREATOR: 'creator'; +}>; diff --git a/src/permissionprovider/src/Shared/PermissionLevelUtils.d.ts b/src/permissionprovider/src/Shared/PermissionLevelUtils.d.ts new file mode 100644 index 00000000000..bb6f8ea850f --- /dev/null +++ b/src/permissionprovider/src/Shared/PermissionLevelUtils.d.ts @@ -0,0 +1,5 @@ +import { PermissionLevel } from './PermissionLevel'; + +export namespace PermissionLevelUtils { + function isPermissionLevel(value: unknown): value is PermissionLevel; +} diff --git a/src/permissionprovider/src/Shared/PermissionProviderConstants.d.ts b/src/permissionprovider/src/Shared/PermissionProviderConstants.d.ts new file mode 100644 index 00000000000..b78567fab51 --- /dev/null +++ b/src/permissionprovider/src/Shared/PermissionProviderConstants.d.ts @@ -0,0 +1,6 @@ +export const PermissionProviderConstants: Readonly<{ + DEFAULT_REMOTE_FUNCTION_NAME: 'PermissionProviderDefaultRemoteFunction'; + + GROUP_RANK_CONFIG_TYPE: 'GroupRankConfigType'; + SINGLE_USER_CONFIG_TYPE: 'SingleUserConfigType'; +}>; diff --git a/src/physicsutils/index.d.ts b/src/physicsutils/index.d.ts new file mode 100644 index 00000000000..b7666d23fe1 --- /dev/null +++ b/src/physicsutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/PhysicsUtils'; +export * from './src/Shared/RxPhysicsUtils'; diff --git a/src/physicsutils/src/Shared/PhysicsUtils.d.ts b/src/physicsutils/src/Shared/PhysicsUtils.d.ts new file mode 100644 index 00000000000..6e1fd183566 --- /dev/null +++ b/src/physicsutils/src/Shared/PhysicsUtils.d.ts @@ -0,0 +1,30 @@ +export namespace PhysicsUtils { + function getConnectedParts(part: BasePart): BasePart[]; + function getMass(parts: BasePart[]): number; + function estimateBuoyancyContribution( + parts: BasePart[] + ): LuaTuple<[buoyancy: number, mass: number, volume: number]>; + function getCenterOfMass( + parts: BasePart[] + ): LuaTuple<[position: Vector3, mass: number]>; + function momentOfInertia( + part: BasePart, + axis: Vector3, + origin: Vector3 + ): number; + function bodyMomentOfInertia( + parts: BasePart[], + axis: Vector3, + origin: Vector3 + ): number; + function applyForce( + part: BasePart, + force: Vector3, + forcePosition: Vector3 + ): void; + function acceleratePart( + part: BasePart, + emittingPart: BasePart, + acceleration: Vector3 + ): void; +} diff --git a/src/physicsutils/src/Shared/RxPhysicsUtils.d.ts b/src/physicsutils/src/Shared/RxPhysicsUtils.d.ts new file mode 100644 index 00000000000..d44d452b619 --- /dev/null +++ b/src/physicsutils/src/Shared/RxPhysicsUtils.d.ts @@ -0,0 +1,5 @@ +import { Observable } from '@quenty/rx'; + +export namespace RxPhysicUtils { + function observePartMass(part: BasePart): Observable; +} diff --git a/src/pillbacking/index.d.ts b/src/pillbacking/index.d.ts new file mode 100644 index 00000000000..f54317e278e --- /dev/null +++ b/src/pillbacking/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/PillBackingBuilder'; +export * from './src/Client/PillBackingUtils'; diff --git a/src/pillbacking/src/Client/PillBackingBuilder.d.ts b/src/pillbacking/src/Client/PillBackingBuilder.d.ts new file mode 100644 index 00000000000..60d8771912e --- /dev/null +++ b/src/pillbacking/src/Client/PillBackingBuilder.d.ts @@ -0,0 +1,46 @@ +export interface PillBackingBuilderOptions { + ZIndex?: number; + ShadowZIndex?: number; + BackgroundColor3?: Color3; +} + +interface PillBackingBuilder { + CreateSingle(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; + CreateSingleShadow( + gui: GuiObject, + options?: PillBackingBuilderOptions + ): ImageLabel; + CreateShadow( + gui: GuiObject, + options?: PillBackingBuilderOptions + ): ImageLabel & { + UISizeConstraint: UISizeConstraint; + LeftShadow: ImageLabel; + RightShadow: ImageLabel; + }; + CreateCircle(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; + CreateCircleShadow( + gui: GuiObject, + options?: PillBackingBuilderOptions + ): ImageLabel; + CreateLeft(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; + CreateRight(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; + CreateTop(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; + CreateBottom(gui: GuiObject, options?: PillBackingBuilderOptions): ImageLabel; +} + +interface PillBackingBuilderConstructor { + readonly ClassName: 'PillBackingBuilder'; + new (options?: PillBackingBuilderOptions): PillBackingBuilder; + + CIRCLE_IMAGE_ID: 'rbxassetid://633244888'; + CIRCLE_SIZE: Vector2; + SHADOW_IMAGE_ID: 'rbxassetid://707852973'; + SHADOW_SIZE: Vector2; + PILL_SHADOW_IMAGE_ID: 'rbxassetid://1304004290'; + PILL_SHADOW_SIZE: Vector2; + SHADOW_OFFSET_Y: UDim; + SHADOW_TRANSPARENCY: 0.85; +} + +export const PillBackingBuilder: PillBackingBuilderConstructor; diff --git a/src/pillbacking/src/Client/PillBackingUtils.d.ts b/src/pillbacking/src/Client/PillBackingUtils.d.ts new file mode 100644 index 00000000000..8d0386f5448 --- /dev/null +++ b/src/pillbacking/src/Client/PillBackingUtils.d.ts @@ -0,0 +1,5 @@ +export namespace PillBackingUtils { + function setBackgroundColor(backing: Frame, color3: Color3): void; + function setTransparency(backing: Frame, transparency: number): void; + function setShadowTransparency(backing: Frame, transparency: number): void; +} diff --git a/src/playerbinder/index.d.ts b/src/playerbinder/index.d.ts new file mode 100644 index 00000000000..7ec509c2295 --- /dev/null +++ b/src/playerbinder/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/PlayerBinder'; diff --git a/src/playerbinder/src/Server/PlayerBinder.d.ts b/src/playerbinder/src/Server/PlayerBinder.d.ts new file mode 100644 index 00000000000..b7acfbf357b --- /dev/null +++ b/src/playerbinder/src/Server/PlayerBinder.d.ts @@ -0,0 +1,16 @@ +import { Binder } from '@quenty/binder'; + +interface PlayerBinder extends Binder {} + +interface PlayerBinderConstructor { + readonly ClassName: 'PlayerBinder'; + new ( + tag: string, + boundClass: { + new (...args: T): R; + }, + ...args: T + ): PlayerBinder; +} + +export const PlayerBinder: PlayerBinderConstructor; diff --git a/src/playerhumanoidbinder/index.d.ts b/src/playerhumanoidbinder/index.d.ts new file mode 100644 index 00000000000..5097204339b --- /dev/null +++ b/src/playerhumanoidbinder/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Server/PlayerCharacterBinder'; +export * from './src/Server/PlayerHumanoidBinder'; diff --git a/src/playerhumanoidbinder/src/Server/PlayerCharacterBinder.d.ts b/src/playerhumanoidbinder/src/Server/PlayerCharacterBinder.d.ts new file mode 100644 index 00000000000..8b75d03042c --- /dev/null +++ b/src/playerhumanoidbinder/src/Server/PlayerCharacterBinder.d.ts @@ -0,0 +1,24 @@ +import { Binder } from '@quenty/binder'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface PlayerCharacterBinder extends Omit, 'Init'> { + Init(serviceBag: ServiceBag): void; + SetAutomaticTagging(shouldTag: boolean): void; + ObserveAutomaticTagging(): Observable; + ObserveAutomaticTaggingBrio( + predicate?: (value: boolean) => boolean + ): Observable>; +} + +interface PlayerCharacterBinderConstructor { + readonly ClassName: 'PlayerCharacterBinder'; + new ( + tag: string, + constructor: { new (...args: unknown[]): T }, + ...args: unknown[] + ): PlayerCharacterBinder; +} + +export const PlayerCharacterBinder: PlayerCharacterBinderConstructor; diff --git a/src/playerhumanoidbinder/src/Server/PlayerHumanoidBinder.d.ts b/src/playerhumanoidbinder/src/Server/PlayerHumanoidBinder.d.ts new file mode 100644 index 00000000000..81b6f9cd197 --- /dev/null +++ b/src/playerhumanoidbinder/src/Server/PlayerHumanoidBinder.d.ts @@ -0,0 +1,24 @@ +import { Binder } from '@quenty/binder'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface PlayerHumanoidBinder extends Omit, 'Init'> { + Init(serviceBag: ServiceBag): void; + SetAutomaticTagging(shouldTag: boolean): void; + ObserveAutomaticTagging(): Observable; + ObserveAutomaticTaggingBrio( + predicate?: (value: boolean) => boolean + ): Observable>; +} + +interface PlayerHumanoidBinderConstructor { + readonly ClassName: 'PlayerHumanoidBinder'; + new ( + tag: string, + constructor: { new (...args: unknown[]): T }, + ...args: unknown[] + ): PlayerHumanoidBinder; +} + +export const PlayerHumanoidBinder: PlayerHumanoidBinderConstructor; diff --git a/src/playerinputmode/index.d.ts b/src/playerinputmode/index.d.ts new file mode 100644 index 00000000000..bd16a76d1d5 --- /dev/null +++ b/src/playerinputmode/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/PlayerInputModeServiceClient'; +export * from './src/Server/PlayerInputModeService'; +export * from './src/Shared/PlayerInputModeServiceConstants'; +export * from './src/Shared/PlayerInputModeTypes'; +export * from './src/Shared/PlayerInputModeUtils'; diff --git a/src/playerinputmode/src/Client/PlayerInputModeServiceClient.d.ts b/src/playerinputmode/src/Client/PlayerInputModeServiceClient.d.ts new file mode 100644 index 00000000000..dd41ab8f796 --- /dev/null +++ b/src/playerinputmode/src/Client/PlayerInputModeServiceClient.d.ts @@ -0,0 +1,14 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerInputMode } from '../Shared/PlayerInputModeTypes'; + +export interface PlayerInputModeServiceClient { + readonly ServiceName: 'PlayerInputModeServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + ObservePlayerInputType( + player: Player + ): Observable; + GetPlayerInputModeType(player: Player): PlayerInputMode | undefined; + Destroy(): void; +} diff --git a/src/playerinputmode/src/Server/PlayerInputModeService.d.ts b/src/playerinputmode/src/Server/PlayerInputModeService.d.ts new file mode 100644 index 00000000000..fdd4ed5685c --- /dev/null +++ b/src/playerinputmode/src/Server/PlayerInputModeService.d.ts @@ -0,0 +1,19 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerInputMode } from '../Shared/PlayerInputModeTypes'; +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +export interface PlayerInputModeService { + readonly ServiceName: 'PlayerInputModeService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetPlayerInputModeType(player: Player): PlayerInputMode | undefined; + PromisePlayerInputMode( + player: Player, + cancelToken?: CancelToken + ): Promise; + ObservePlayerInputType( + player: Player + ): Observable; +} diff --git a/src/playerinputmode/src/Shared/PlayerInputModeServiceConstants.d.ts b/src/playerinputmode/src/Shared/PlayerInputModeServiceConstants.d.ts new file mode 100644 index 00000000000..b578cd6c24a --- /dev/null +++ b/src/playerinputmode/src/Shared/PlayerInputModeServiceConstants.d.ts @@ -0,0 +1,5 @@ +export const PlayerInputModeServiceConstants: Readonly<{ + REMOTE_EVENT_NAME: 'PlayerInputModeRemoteEvent'; + INPUT_MODE_ATTRIBUTE: 'PlayerInputMode'; + REQUEST_SET_INPUT_MODE: 'requestSetInputMode'; +}>; diff --git a/src/playerinputmode/src/Shared/PlayerInputModeTypes.d.ts b/src/playerinputmode/src/Shared/PlayerInputModeTypes.d.ts new file mode 100644 index 00000000000..783885da81d --- /dev/null +++ b/src/playerinputmode/src/Shared/PlayerInputModeTypes.d.ts @@ -0,0 +1,7 @@ +export type PlayerInputMode = 'gamepad' | 'touch' | 'keyboard'; + +export const PlayerInputModeTypes: Readonly<{ + GAMEPAD: 'gamepad'; + TOUCH: 'touch'; + KEYBOARD: 'keyboard'; +}>; diff --git a/src/playerinputmode/src/Shared/PlayerInputModeUtils.d.ts b/src/playerinputmode/src/Shared/PlayerInputModeUtils.d.ts new file mode 100644 index 00000000000..f4cff453db6 --- /dev/null +++ b/src/playerinputmode/src/Shared/PlayerInputModeUtils.d.ts @@ -0,0 +1,20 @@ +import { Observable } from '@quenty/rx'; +import { PlayerInputMode } from './PlayerInputModeTypes'; +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; + +export namespace PlayerInputModeUtils { + function getPlayerInputModeType(player: Player): PlayerInputMode | undefined; + function observePlayerInputModeType( + player: Player + ): Observable; + function promisePlayerInputMode( + player: Player, + cancelToken?: CancelToken + ): Promise; + function isInputModeType(value: unknown): value is PlayerInputMode; + function setPlayerInputModeType( + player: Player, + playerInputModeType: PlayerInputMode + ): void; +} diff --git a/src/playersservicepromises/index.d.ts b/src/playersservicepromises/index.d.ts new file mode 100644 index 00000000000..59ec5bc2b69 --- /dev/null +++ b/src/playersservicepromises/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PlayersServicePromises'; diff --git a/src/playersservicepromises/src/Shared/PlayersServicePromises.d.ts b/src/playersservicepromises/src/Shared/PlayersServicePromises.d.ts new file mode 100644 index 00000000000..8ecd2437e1f --- /dev/null +++ b/src/playersservicepromises/src/Shared/PlayersServicePromises.d.ts @@ -0,0 +1,5 @@ +import { Promise } from '@quenty/promise'; + +export namespace PlayersServicePromises { + function promiseUserIdFromName(name: string): Promise; +} diff --git a/src/playerthumbnailutils/index.d.ts b/src/playerthumbnailutils/index.d.ts new file mode 100644 index 00000000000..2cae3e07bdc --- /dev/null +++ b/src/playerthumbnailutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PlayerThumbnailUtils'; diff --git a/src/playerthumbnailutils/src/Shared/PlayerThumbnailUtils.d.ts b/src/playerthumbnailutils/src/Shared/PlayerThumbnailUtils.d.ts new file mode 100644 index 00000000000..854505b2289 --- /dev/null +++ b/src/playerthumbnailutils/src/Shared/PlayerThumbnailUtils.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; + +export namespace PlayerThumbnailUtils { + function promiseUserThumbnail( + userId: number, + thumbnailType?: Enum.ThumbnailType, + thumbnailSize?: Enum.ThumbnailSize + ): Promise; + function promiseUserName(userId: number): Promise; +} diff --git a/src/playerutils/index.d.ts b/src/playerutils/index.d.ts new file mode 100644 index 00000000000..85c4cdcc4d4 --- /dev/null +++ b/src/playerutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxPlayerUtils'; +export * from './src/Shared/PlayerUtils'; diff --git a/src/playerutils/src/Shared/PlayerUtils.d.ts b/src/playerutils/src/Shared/PlayerUtils.d.ts new file mode 100644 index 00000000000..5d9deb249f7 --- /dev/null +++ b/src/playerutils/src/Shared/PlayerUtils.d.ts @@ -0,0 +1,18 @@ +import { Promise } from '@quenty/promise'; + +export namespace PlayerUtils { + function formatName(player: Player): string; + function formatDisplayName(name: string, displayName: string): string; + function formatDisplayNameFromUserInfo(userInfo: { + Username: string; + DisplayName: string; + HasVerifiedBadge: boolean; + }): string; + function addVerifiedBadgeToName(name: string): string; + function getDefaultNameColor(displayName: string): Color3; + function promiseLoadCharacter(player: Player): Promise; + function promiseLoadCharacterWithHumanoidDescription( + player: Player, + humanoidDescription: HumanoidDescription + ): Promise; +} diff --git a/src/playerutils/src/Shared/RxPlayerUtils.d.ts b/src/playerutils/src/Shared/RxPlayerUtils.d.ts new file mode 100644 index 00000000000..b0e6fdb3156 --- /dev/null +++ b/src/playerutils/src/Shared/RxPlayerUtils.d.ts @@ -0,0 +1,13 @@ +import { Observable, Predicate } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export namespace RxPlayerUtils { + function observePlayersBrio( + predicate?: Predicate + ): Observable>; + function observeLocalPlayerBrio( + predicate?: Predicate + ): Observable>; + function observePlayers(predicate?: Predicate): Observable; + function observeFirstAppearanceLoaded(player: Player): Observable; +} diff --git a/src/policyserviceutils/index.d.ts b/src/policyserviceutils/index.d.ts new file mode 100644 index 00000000000..a824dc8aa2d --- /dev/null +++ b/src/policyserviceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PolicyServiceUtils'; diff --git a/src/policyserviceutils/src/Shared/PolicyServiceUtils.d.ts b/src/policyserviceutils/src/Shared/PolicyServiceUtils.d.ts new file mode 100644 index 00000000000..b4ac4cd7b13 --- /dev/null +++ b/src/policyserviceutils/src/Shared/PolicyServiceUtils.d.ts @@ -0,0 +1,14 @@ +import { Promise } from '@quenty/promise'; + +export namespace PolicyServiceUtils { + function promisePolicyInfoForPlayer(player: Player): Promise; + function canReferenceTwitter(policyInfo: PolicyInfo): boolean; + function canReferenceTwitch(policyInfo: PolicyInfo): boolean; + function canReferenceDiscord(policyInfo: PolicyInfo): boolean; + function canReferenceFacebook(policyInfo: PolicyInfo): boolean; + function canReferenceYouTube(policyInfo: PolicyInfo): boolean; + function canReferenceSocialMedia( + policyInfo: PolicyInfo, + socialInfoName: string + ): boolean; +} diff --git a/src/polynomialutils/index.d.ts b/src/polynomialutils/index.d.ts new file mode 100644 index 00000000000..5f5c138831a --- /dev/null +++ b/src/polynomialutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PolynomialUtils'; diff --git a/src/polynomialutils/src/Shared/PolynomialUtils.d.ts b/src/polynomialutils/src/Shared/PolynomialUtils.d.ts new file mode 100644 index 00000000000..860ece9c5d8 --- /dev/null +++ b/src/polynomialutils/src/Shared/PolynomialUtils.d.ts @@ -0,0 +1,8 @@ +export namespace PolynomialUtils { + function solveOrderedRealLinear(a: number, b: number): number | undefined; + function solveOrderedRealQuadratic( + a: number, + b: number, + c: number + ): LuaTuple<[number | undefined, number | undefined]>; +} diff --git a/src/preferredparentutils/index.d.ts b/src/preferredparentutils/index.d.ts new file mode 100644 index 00000000000..ecdf5339e5b --- /dev/null +++ b/src/preferredparentutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PreferredParentUtils'; diff --git a/src/preferredparentutils/src/Shared/PreferredParentUtils.d.ts b/src/preferredparentutils/src/Shared/PreferredParentUtils.d.ts new file mode 100644 index 00000000000..ace1bd8334c --- /dev/null +++ b/src/preferredparentutils/src/Shared/PreferredParentUtils.d.ts @@ -0,0 +1,12 @@ +export namespace PreferredParentUtils { + function createPreferredParentRetriever( + parent: Instance, + name: string, + forceCreate?: boolean + ): () => Instance; + function getPreferredParent( + parent: Instance, + name: string, + forceCreate?: boolean + ): Instance; +} diff --git a/src/probability/index.d.ts b/src/probability/index.d.ts new file mode 100644 index 00000000000..a2e596d2dfe --- /dev/null +++ b/src/probability/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Probability'; diff --git a/src/probability/src/Shared/Probability.d.ts b/src/probability/src/Shared/Probability.d.ts new file mode 100644 index 00000000000..5cb0e3d97ce --- /dev/null +++ b/src/probability/src/Shared/Probability.d.ts @@ -0,0 +1,14 @@ +export namespace Probability { + function boxMuller(): number; + function normal(mean: number, standardDeviation: number): number; + function boundedNormal( + mean: number, + standardDeviation: number, + hardMin: number, + hardMax: number + ): number; + function erf(x: number): number; + function cdf(zScore: number): number; + function erfinv(x: number): number | undefined; + function percentileToZScore(percentile: number): number | undefined; +} diff --git a/src/promise/index.d.ts b/src/promise/index.d.ts new file mode 100644 index 00000000000..41e2562625d --- /dev/null +++ b/src/promise/index.d.ts @@ -0,0 +1,8 @@ +export * from './src/Shared/Promise'; +export * from './src/Shared/PromiseRetryUtils'; +export * from './src/Shared/PromiseUtils'; +export * from './src/Shared/Utility/PendingPromiseTracker'; +export * from './src/Shared/Utility/PromiseInstanceUtils'; +export * from './src/Shared/Utility/promiseChild'; +export * from './src/Shared/Utility/promisePropertyValue'; +export * from './src/Shared/Utility/promiseWait'; diff --git a/src/promise/src/Shared/Promise.d.ts b/src/promise/src/Shared/Promise.d.ts new file mode 100644 index 00000000000..9d1ee697581 --- /dev/null +++ b/src/promise/src/Shared/Promise.d.ts @@ -0,0 +1,40 @@ +type ToTuple = [T] extends [LuaTuple] ? V : [T]; + +type Resolve = (...args: ToTuple) => void; +type Reject = (error: unknown) => void; +type ResolveReject = (resolve: Resolve, reject: Reject) => void; + +type Promise = { + Then( + onFulfilled: (...values: ToTuple) => R, + onRejected?: (error: unknown) => void + ): Promise; + Catch(onRejected: (error: unknown) => void): Promise; + Finally(onFinally: (...values: ToTuple) => void): Promise; + Tap( + onFulfilled: (...values: ToTuple) => void, + onRejected?: (error: unknown) => void + ): Promise; + + Destroy(): void; +}; + +interface PromiseConstructor { + readonly ClassName: 'Promise'; + new ( + func: ( + resolve: (...values: ToTuple) => void, + reject: (error: unknown) => void + ) => void + ): Promise; + + spawn: (func: ResolveReject) => Promise; + delay: (seconds: number, func: ResolveReject) => Promise; + defer: (func: ResolveReject) => Promise; + resolved: (...values: ToTuple) => Promise; + rejected: (...args: unknown[]) => Promise; + + isPromise: (value: unknown) => value is Promise; +} + +export const Promise: PromiseConstructor; diff --git a/src/promise/src/Shared/PromiseRetryUtils.d.ts b/src/promise/src/Shared/PromiseRetryUtils.d.ts new file mode 100644 index 00000000000..6e37be26572 --- /dev/null +++ b/src/promise/src/Shared/PromiseRetryUtils.d.ts @@ -0,0 +1,12 @@ +import { Promise } from './Promise'; + +export namespace PromiseRetryUtils { + function retry( + callback: () => Promise, + options: { + initialWaitTime: number; + maxAttempts: number; + printWarning: boolean; + } + ): Promise; +} diff --git a/src/promise/src/Shared/PromiseUtils.d.ts b/src/promise/src/Shared/PromiseUtils.d.ts new file mode 100644 index 00000000000..2666798ba37 --- /dev/null +++ b/src/promise/src/Shared/PromiseUtils.d.ts @@ -0,0 +1,13 @@ +import { Signal } from '@quenty/signal'; +import { Promise } from './Promise'; + +export namespace PromiseUtils { + function any(promises: Promise[]): Promise; + function delayed(seconds: number): Promise; + function all(promises: Promise[]): Promise; + function firstSuccessOrLastFailure(promises: Promise[]): Promise; + function combine(promises: Map>): Promise>; + function invert(promise: Promise): Promise; + function fromSignal(signal: Signal): Promise; + function timeout(timeoutTime: number, fromPromise: Promise): Promise; +} diff --git a/src/promise/src/Shared/Utility/PendingPromiseTracker.d.ts b/src/promise/src/Shared/Utility/PendingPromiseTracker.d.ts new file mode 100644 index 00000000000..e7a99182cff --- /dev/null +++ b/src/promise/src/Shared/Utility/PendingPromiseTracker.d.ts @@ -0,0 +1,13 @@ +import { Promise } from '../Promise'; + +interface PendingPromiseTracker { + Add(promise: Promise): Promise; + GetAll(): Promise[]; +} + +interface PendingPromiseTrackerConstructor { + readonly ClassName: 'PendingPromiseTracker'; + new (): PendingPromiseTracker; +} + +export const PendingPromiseTracker: PendingPromiseTrackerConstructor; diff --git a/src/promise/src/Shared/Utility/PromiseInstanceUtils.d.ts b/src/promise/src/Shared/Utility/PromiseInstanceUtils.d.ts new file mode 100644 index 00000000000..9988740184b --- /dev/null +++ b/src/promise/src/Shared/Utility/PromiseInstanceUtils.d.ts @@ -0,0 +1,5 @@ +import { Promise } from '../Promise'; + +export namespace PromiseInstanceUtils { + function promiseRemoved(instance: Instance): Promise; +} diff --git a/src/promise/src/Shared/Utility/promiseChild.d.ts b/src/promise/src/Shared/Utility/promiseChild.d.ts new file mode 100644 index 00000000000..56088b99965 --- /dev/null +++ b/src/promise/src/Shared/Utility/promiseChild.d.ts @@ -0,0 +1,7 @@ +import { Promise } from '../Promise'; + +export const promiseChild: ( + parent: Instance, + name: string, + timeOut?: number +) => Promise; diff --git a/src/promise/src/Shared/Utility/promisePropertyValue.d.ts b/src/promise/src/Shared/Utility/promisePropertyValue.d.ts new file mode 100644 index 00000000000..63a4c2984f4 --- /dev/null +++ b/src/promise/src/Shared/Utility/promisePropertyValue.d.ts @@ -0,0 +1,7 @@ +export const promisePropertyValue: < + T extends Instance, + V extends keyof InstanceProperties +>( + instance: T, + propertyName: V +) => Promise[V]>; diff --git a/src/promise/src/Shared/Utility/promiseWait.d.ts b/src/promise/src/Shared/Utility/promiseWait.d.ts new file mode 100644 index 00000000000..1dfd864cc63 --- /dev/null +++ b/src/promise/src/Shared/Utility/promiseWait.d.ts @@ -0,0 +1,3 @@ +import { Promise } from '../Promise'; + +export const promiseWait: (time: number) => Promise; diff --git a/src/promisemaid/index.d.ts b/src/promisemaid/index.d.ts new file mode 100644 index 00000000000..6b4c6d5e68d --- /dev/null +++ b/src/promisemaid/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PromiseMaidUtils'; diff --git a/src/promisemaid/src/Shared/PromiseMaidUtils.d.ts b/src/promisemaid/src/Shared/PromiseMaidUtils.d.ts new file mode 100644 index 00000000000..2972213b367 --- /dev/null +++ b/src/promisemaid/src/Shared/PromiseMaidUtils.d.ts @@ -0,0 +1,9 @@ +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +export namespace PromiseMaidUtils { + function whilePromise( + promise: Promise, + callback: (maid: Maid) => void + ): Maid; +} diff --git a/src/promptqueue/index.d.ts b/src/promptqueue/index.d.ts new file mode 100644 index 00000000000..fc7fc949d03 --- /dev/null +++ b/src/promptqueue/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PromptQueue'; diff --git a/src/promptqueue/src/Shared/PromptQueue.d.ts b/src/promptqueue/src/Shared/PromptQueue.d.ts new file mode 100644 index 00000000000..8b2e28d3804 --- /dev/null +++ b/src/promptqueue/src/Shared/PromptQueue.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { TransitionModel } from '@quenty/transitionmodel'; + +interface PromptQueue extends BaseObject { + Queue(transitionModel: TransitionModel): Promise; + HasItems(): boolean; + Clear(doNotAnimate?: boolean): void; + HideCurrent(doNotAnimate?: boolean): Promise; + IsShowing(): boolean; + ObserveIsShowing(): Observable; +} + +interface PromptQueueConstructor { + readonly ClassName: 'PromptQueue'; + new (): PromptQueue; +} + +export const PromptQueue: PromptQueueConstructor; diff --git a/src/propertyvalue/index.d.ts b/src/propertyvalue/index.d.ts new file mode 100644 index 00000000000..0f11ced0c3f --- /dev/null +++ b/src/propertyvalue/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PropertyValue'; diff --git a/src/propertyvalue/src/Shared/PropertyValue.d.ts b/src/propertyvalue/src/Shared/PropertyValue.d.ts new file mode 100644 index 00000000000..c6086354169 --- /dev/null +++ b/src/propertyvalue/src/Shared/PropertyValue.d.ts @@ -0,0 +1,24 @@ +import { Brio } from '@quenty/brio'; +import { Observable, Predicate } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface PropertyValue< + I extends Instance, + P extends keyof InstanceProperties, + V extends InstanceProperties[P] = InstanceProperties[P] +> { + Value: V; + readonly Changed: Signal; + Observe(): Observable; + ObserveBrio(condition?: Predicate): Observable>; +} + +interface PropertyValueConstructor { + readonly ClassName: 'PropertyValue'; + new >( + instance: I, + propertyName: P + ): PropertyValue; +} + +export const PropertyValue: PropertyValueConstructor; diff --git a/src/pseudolocalize/index.d.ts b/src/pseudolocalize/index.d.ts new file mode 100644 index 00000000000..13bd85a94dc --- /dev/null +++ b/src/pseudolocalize/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/PseudoLocalize'; diff --git a/src/pseudolocalize/src/Shared/PseudoLocalize.d.ts b/src/pseudolocalize/src/Shared/PseudoLocalize.d.ts new file mode 100644 index 00000000000..6cf33a2ae90 --- /dev/null +++ b/src/pseudolocalize/src/Shared/PseudoLocalize.d.ts @@ -0,0 +1,10 @@ +export namespace PseudoLocalize { + function pseudoLocalize(line: string): string; + function getDefaultPseudoLocaleId(): string; + function addToLocalizationTable( + localizationTable: LocalizationTable, + preferredLocaleId?: string, + preferredFromLocale?: string + ): void; + const PSEUDO_CHARACTER_MAP: Record; +} diff --git a/src/qframe/index.d.ts b/src/qframe/index.d.ts new file mode 100644 index 00000000000..8bfac839a82 --- /dev/null +++ b/src/qframe/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/QFrame'; diff --git a/src/qframe/src/Shared/QFrame.d.ts b/src/qframe/src/Shared/QFrame.d.ts new file mode 100644 index 00000000000..e9076f1c4c6 --- /dev/null +++ b/src/qframe/src/Shared/QFrame.d.ts @@ -0,0 +1,24 @@ +type QFrame = { + toCFrame(): CFrame; + toPosition(): Vector3; +}; + +interface QFrameConstructor { + readonly ClassName: 'QFrame'; + new ( + x?: number, + y?: number, + z?: number, + W?: number, + X?: number, + Y?: number, + Z?: number + ): QFrame; + + isQFrame: (value: unknown) => value is QFrame; + fromCFrameClosestTo: (cframe: CFrame, closestTo: QFrame) => QFrame; + fromVector3: (vector: Vector3, qframe: QFrame) => QFrame; + isNAN: (qframe: QFrame) => boolean; +} + +export const QFrame: QFrameConstructor; diff --git a/src/qgui/index.d.ts b/src/qgui/index.d.ts new file mode 100644 index 00000000000..fb77f847b30 --- /dev/null +++ b/src/qgui/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/qGUI'; diff --git a/src/qgui/src/Shared/qGUI.d.ts b/src/qgui/src/Shared/qGUI.d.ts new file mode 100644 index 00000000000..98e2e37929a --- /dev/null +++ b/src/qgui/src/Shared/qGUI.d.ts @@ -0,0 +1,60 @@ +type OnlyPropertiesOfType = { + [K in keyof O as O[K] extends T ? K : never]: O[K]; +}; + +export namespace qGUI { + function PointInBounds(frame: Frame, x: number, y: number): boolean; + function MouseOver(mouse: Mouse, frame: Frame): boolean; + function TweenTransparency( + gui: T, + newProperties: Partial< + OnlyPropertiesOfType, number> + >, + duration: number + ): void; + function StopTransparencyTween(gui: GuiBase): void; + function TweenColor3( + gui: T, + newProperties: Partial< + OnlyPropertiesOfType, Color3> + >, + duration: number + ): void; + function StopColor3Tween(gui: GuiBase): void; + function AddTexturedWindowTemplate< + T extends keyof CreatableInstances = 'Frame' + >( + frame: Frame, + radius: number, + type?: T + ): LuaTuple< + [ + topLeft: Instances[T], + topRight: Instances[T], + bottomLeft: Instances[T], + bottomRight: Instances[T], + middle: Instances[T], + middleLeft: Instances[T], + middleRight: Instances[T] + ] + >; + function AddNinePatch( + frame: Frame, + image: string, + imageSize: Vector2, + radius: number, + type?: T, + properties?: Partial> + ): LuaTuple< + [ + ...ReturnType>, + middleTop: Instances[T], + middleBottom: Instances[T] + ] + >; + function BackWithRoundedRectangle( + frame: Frame, + radius: number, + color?: Color3 + ): ReturnType>; +} diff --git a/src/quaternion/index.d.ts b/src/quaternion/index.d.ts new file mode 100644 index 00000000000..3e748050e4b --- /dev/null +++ b/src/quaternion/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Quaternion'; +export * from './src/Shared/QuaternionObject'; diff --git a/src/quaternion/src/Shared/Quaternion.d.ts b/src/quaternion/src/Shared/Quaternion.d.ts new file mode 100644 index 00000000000..575a0e8ff36 --- /dev/null +++ b/src/quaternion/src/Shared/Quaternion.d.ts @@ -0,0 +1,69 @@ +type MathLike = number | Vector3 | Vector2; + +type Quaternion = [w: number, x: number, y: number, z: number]; + +export namespace Quaternion { + function BezierPosition( + x0: T, + x1: T, + v0: T, + v1: T, + t: number + ): T; + function BezierVelocity( + x0: T, + x1: T, + v0: T, + v1: T, + t: number + ): T; + function Qmul(q1: Quaternion, q2: Quaternion): Quaternion; + function Qinv(q: Quaternion): Quaternion; + function Qpow(q: Quaternion, exponent: number, choice?: number): Quaternion; + function QuaternionFromCFrame(cf: CFrame): Quaternion; + function SlerpQuaternions( + q0: Quaternion, + q1: Quaternion, + t: number + ): Quaternion; + function QuaternionToCFrame(q: Quaternion): number[]; + function BezierRotation( + q0: Quaternion, + q1: Quaternion, + w0: Quaternion, + w1: Quaternion, + t: number + ): Quaternion; + function BezierAngularV( + q0: Quaternion, + q1: Quaternion, + w0: Quaternion, + w1: Quaternion, + t: number + ): Quaternion; + const Tweens: Record; + const QuaternionTweens: Record; + const CFrameTweens: Record; + function updateTweens(timeNow: number): void; + function updateQuaternionTweens(timeNow: number): void; + function updateCFrameTweens(timeNow: number): void; + function newTween( + name: unknown, + value: T, + updateFunction: (value: T) => void, + time: number + ): void; + function newQuaternionTween( + name: unknown, + value: Quaternion, + updateFunction: (value: Quaternion) => void, + time: number, + autoChoose?: boolean + ): void; + function newCFrameTween( + name: unknown, + value: CFrame, + updateFunction: (value: CFrame) => void, + time: number + ): void; +} diff --git a/src/quaternion/src/Shared/QuaternionObject.d.ts b/src/quaternion/src/Shared/QuaternionObject.d.ts new file mode 100644 index 00000000000..4e62a7ec130 --- /dev/null +++ b/src/quaternion/src/Shared/QuaternionObject.d.ts @@ -0,0 +1,26 @@ +interface QuaternionObject { + toCFrame(position: Vector3): CFrame; + inv(): QuaternionObject; + unm(): QuaternionObject; + add(other: QuaternionObject): QuaternionObject; + sub(other: QuaternionObject): QuaternionObject; + mul(other: QuaternionObject | number): QuaternionObject; + div(other: QuaternionObject | number): QuaternionObject; + pow(exponent: QuaternionObject | number): QuaternionObject; + length(): number; + magnitude(): number; + tostring(): string; + log(): QuaternionObject; + exp(): QuaternionObject; + normalize(): QuaternionObject; + unit(): QuaternionObject; + sqrt(): QuaternionObject; +} + +interface QuaternionObjectConstructor { + new (w: number, x: number, y: number, z: number): QuaternionObject; + + fromCFrame: (cframe: CFrame) => QuaternionObject; +} + +export const QuaternionObject: QuaternionObjectConstructor; diff --git a/src/queue/index.d.ts b/src/queue/index.d.ts new file mode 100644 index 00000000000..80d9bb7b5cd --- /dev/null +++ b/src/queue/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Queue'; diff --git a/src/queue/src/Shared/Queue.d.ts b/src/queue/src/Shared/Queue.d.ts new file mode 100644 index 00000000000..bef76711312 --- /dev/null +++ b/src/queue/src/Shared/Queue.d.ts @@ -0,0 +1,17 @@ +type Queue = { + PushLeft(value: T): void; + PushRight(value: T): void; + PopLeft(): T; + PopRight(): T; + IsEmpty(): boolean; + GetCount(): number; + Destroy(): void; + __len(): number; +}; + +interface QueueConstructor { + readonly ClassName: 'Queue'; + new (): Queue; +} + +export const Queue: QueueConstructor; diff --git a/src/r15utils/index.d.ts b/src/r15utils/index.d.ts new file mode 100644 index 00000000000..f03df9dfce2 --- /dev/null +++ b/src/r15utils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/R15Utils'; +export * from './src/Shared/RxR15Utils'; diff --git a/src/r15utils/src/Shared/R15Utils.d.ts b/src/r15utils/src/Shared/R15Utils.d.ts new file mode 100644 index 00000000000..4cdfdc685ca --- /dev/null +++ b/src/r15utils/src/Shared/R15Utils.d.ts @@ -0,0 +1,69 @@ +export namespace R15Utils { + function searchForRigAttachment( + character: Model, + partName: string, + attachmentName: string + ): Attachment | undefined; + function getRigMotor( + character: Model, + partName: string, + motorName: string + ): Motor6D | undefined; + function getUppertorso(character: Model): BasePart | undefined; + function getLowerTorso(character: Model): BasePart | undefined; + function getBodyPart( + character: Model, + partName: string + ): BasePart | undefined; + function getWaistJoint(character: Model): Motor6D | undefined; + function getNeckJoint(character: Model): Motor6D | undefined; + function getHand( + character: Model, + side: 'Left' | 'Right' + ): BasePart | undefined; + function getGripWeld( + character: Model, + side: 'Left' | 'Right' + ): Motor6D | undefined; + function getGripWeldName(side: 'Left' | 'Right'): 'LeftGrip' | 'RightGrip'; + function getHandName(side: 'Left' | 'Right'): 'LeftHand' | 'RightHand'; + function getGripAttachmentName( + side: 'Left' | 'Right' + ): 'LeftGripAttachment' | 'RightGripAttachment'; + function getShoulderRigAttachment( + character: Model, + side: 'Left' | 'Right' + ): Attachment | undefined; + function getGripAttachment( + character: Model, + side: 'Left' | 'Right' + ): Attachment | undefined; + function getExpectedRootPartYOffset(humanoid: Humanoid): number | undefined; + function getRigLength( + character: Model, + partName: string, + rigAttachment0: string, + rigAttachment1: string + ): number | undefined; + function addLengthsOrNil(lengths: (number | undefined)[]): number | undefined; + function getUpperArmRigLength( + character: Model, + side: 'Left' | 'Right' + ): number | undefined; + function getLowerArmRigLength( + character: Model, + side: 'Left' | 'Right' + ): number | undefined; + function getWristToGripLength( + character: Model, + side: 'Left' | 'Right' + ): number | undefined; + function getHumanoidScaleProperty( + humanoid: Humanoid, + scaleValueName: string + ): number | undefined; + function getArmRigToGripLength( + character: Model, + side: 'Left' | 'Right' + ): number | undefined; +} diff --git a/src/r15utils/src/Shared/RxR15Utils.d.ts b/src/r15utils/src/Shared/RxR15Utils.d.ts new file mode 100644 index 00000000000..dcc058cd435 --- /dev/null +++ b/src/r15utils/src/Shared/RxR15Utils.d.ts @@ -0,0 +1,37 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxR15Utils { + function observeRigAttachmentBrio( + character: Model, + partName: string, + attachmentName: string + ): Observable>; + function observeRigMotorBrio( + character: Model, + partName: string, + motorName: string + ): Observable>; + function observeRigWeldBrio( + character: Model, + partName: string, + weldName: string + ): Observable>; + function observeCharacterPartBrio( + character: Model, + partName: string + ): Observable>; + function observeHumanoidBrio(character: Model): Observable>; + function observeHumanoidScaleValueObject( + humanoid: Humanoid, + scaleValueName: string + ): Observable>; + function observeHumanoidScaleProperty( + humanoid: Humanoid, + scaleValueName: string + ): Observable; + function observeShoulderRigAttachmentBrio( + character: Model, + side: 'Left' | 'Right' + ): Observable>; +} diff --git a/src/racketingropeconstraint/index.d.ts b/src/racketingropeconstraint/index.d.ts new file mode 100644 index 00000000000..0eb84505686 --- /dev/null +++ b/src/racketingropeconstraint/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RacketingRopeConstraint'; +export * from './src/Shared/RacketingRopeConstraintInterface'; diff --git a/src/racketingropeconstraint/src/Shared/RacketingRopeConstraint.d.ts b/src/racketingropeconstraint/src/Shared/RacketingRopeConstraint.d.ts new file mode 100644 index 00000000000..02ddc82a2c4 --- /dev/null +++ b/src/racketingropeconstraint/src/Shared/RacketingRopeConstraint.d.ts @@ -0,0 +1,22 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +interface BoundRacketingRopeConstraint extends BaseObject { + PromiseConstrained(): Promise; + ObserveIsConstrained(): Observable; +} + +interface BoundRacketingRopeConstraintConstructor { + readonly ClassName: 'BoundRacketingRopeConstraint'; + new ( + ropeConstraint: RopeConstraint, + serviceBag: ServiceBag + ): BoundRacketingRopeConstraint; +} + +export const BoundRacketingRopeConstraint: BoundRacketingRopeConstraintConstructor; + +export const RacketingRopeConstraint: Binder; diff --git a/src/racketingropeconstraint/src/Shared/RacketingRopeConstraintInterface.d.ts b/src/racketingropeconstraint/src/Shared/RacketingRopeConstraintInterface.d.ts new file mode 100644 index 00000000000..a40aad21bb4 --- /dev/null +++ b/src/racketingropeconstraint/src/Shared/RacketingRopeConstraintInterface.d.ts @@ -0,0 +1,9 @@ +import { + TieDefinition, + TieDefinitionMethod, +} from '@quenty/tie/src/Shared/TieDefinition'; + +export const RacketingRopeConstraintInterface: TieDefinition<{ + PromiseConstrained: TieDefinitionMethod; + ObserveIsConstrained: TieDefinitionMethod; +}>; diff --git a/src/radial-image/index.d.ts b/src/radial-image/index.d.ts new file mode 100644 index 00000000000..6d7b8a3ba10 --- /dev/null +++ b/src/radial-image/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/RadialImage'; diff --git a/src/radial-image/src/Client/RadialImage.d.ts b/src/radial-image/src/Client/RadialImage.d.ts new file mode 100644 index 00000000000..9e776482d8d --- /dev/null +++ b/src/radial-image/src/Client/RadialImage.d.ts @@ -0,0 +1,34 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ToPropertyObservableArgument } from '@quenty/blend'; +import { Observable } from '@quenty/rx'; + +interface RadialImage extends BaseObject { + Gui: Frame; + SetImage(image: string): void; + SetPercent(percent: number): void; + SetTransparency(transparency: number): void; + SetEnabledTransparency(transparency: number): void; + SetDisabledTransparency(transparency: number): void; + SetEnabledColor(color: Color3): void; + SetDisabledColor(color: Color3): void; +} + +interface RadialImageConstructor { + readonly ClassName: 'RadialImage'; + new (): RadialImage; + + blend: (props: { + Image?: string | ToPropertyObservableArgument; + Percent?: number | ToPropertyObservableArgument; + EnabledTransparency?: number | ToPropertyObservableArgument; + DisabledTransparency?: number | ToPropertyObservableArgument; + EnabledColor?: Color3 | ToPropertyObservableArgument; + DisabledColor?: Color3 | ToPropertyObservableArgument; + Transparency?: number | ToPropertyObservableArgument; + Size?: UDim2 | ToPropertyObservableArgument; + Position?: UDim2 | ToPropertyObservableArgument; + AnchorPoint?: Vector2 | ToPropertyObservableArgument; + }) => Observable; +} + +export const RadialImage: RadialImageConstructor; diff --git a/src/radial/index.d.ts b/src/radial/index.d.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/radial/index.d.ts-image b/src/radial/index.d.ts-image new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/ragdoll/index.d.ts b/src/ragdoll/index.d.ts new file mode 100644 index 00000000000..fbda3882bb4 --- /dev/null +++ b/src/ragdoll/index.d.ts @@ -0,0 +1,28 @@ +export * from './src/Client/Classes/RagdollCameraShakeClient'; +export * from './src/Client/Classes/RagdollClient'; +export * from './src/Client/Classes/RagdollHumanoidOnDeathClient'; +export * from './src/Client/Classes/RagdollHumanoidOnFallClient'; +export * from './src/Client/Classes/RagdollableClient'; +export * from './src/Client/RagdollBindersClient'; +export * from './src/Client/RagdollServiceClient'; +export * from './src/Server/Classes/Ragdoll'; +export * from './src/Server/Classes/RagdollCameraShake'; +export * from './src/Server/Classes/RagdollHumanoidOnDeath'; +export * from './src/Server/Classes/RagdollHumanoidOnFall'; +export * from './src/Server/Classes/Ragdollable'; +export * from './src/Server/Classes/UnragdollAutomatically'; +export * from './src/Server/Classes/UnragdollAutomaticallyConstants'; +export * from './src/Server/RagdollBindersServer'; +export * from './src/Server/RagdollService'; +export * from './src/Shared/Classes/BindableRagdollHumanoidOnFall'; +export * from './src/Shared/Classes/RagdollHumanoidOnFallConstants'; +export * from './src/Shared/Classes/RagdollableBase'; +export * from './src/Shared/Interfaces/RagdollableInterface'; +export * from './src/Shared/RagdollServiceConstants'; +export * from './src/Shared/Rigging/RagdollAdditionalAttachmentUtils'; +export * from './src/Shared/Rigging/RagdollBallSocketUtils'; +export * from './src/Shared/Rigging/RagdollCollisionUtils'; +export * from './src/Shared/Rigging/RagdollMotorData'; +export * from './src/Shared/Rigging/RagdollMotorLimitData'; +export * from './src/Shared/Rigging/RagdollMotorUtils'; +export * from './src/Shared/Rigging/RxRagdollUtils'; diff --git a/src/ragdoll/src/Client/Classes/RagdollCameraShakeClient.d.ts b/src/ragdoll/src/Client/Classes/RagdollCameraShakeClient.d.ts new file mode 100644 index 00000000000..ffd2f759476 --- /dev/null +++ b/src/ragdoll/src/Client/Classes/RagdollCameraShakeClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { BaseObject } from '@quenty/baseobject'; + +export interface RagdollCameraShakeClient extends BaseObject {} + +export interface RagdollCameraShakeClientConstructor { + readonly ClassName: 'RagdollCameraShakeClient'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollCameraShakeClient; +} + +export const RagdollCameraShakeClient: Binder; diff --git a/src/ragdoll/src/Client/Classes/RagdollClient.d.ts b/src/ragdoll/src/Client/Classes/RagdollClient.d.ts new file mode 100644 index 00000000000..00a88a5a399 --- /dev/null +++ b/src/ragdoll/src/Client/Classes/RagdollClient.d.ts @@ -0,0 +1,12 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface RagdollClient extends BaseObject {} + +export interface RagdollClientConstructor { + readonly ClassName: 'RagdollClient'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollClient; +} + +export const RagdollClient: Binder; diff --git a/src/ragdoll/src/Client/Classes/RagdollHumanoidOnDeathClient.d.ts b/src/ragdoll/src/Client/Classes/RagdollHumanoidOnDeathClient.d.ts new file mode 100644 index 00000000000..7e3523bd69a --- /dev/null +++ b/src/ragdoll/src/Client/Classes/RagdollHumanoidOnDeathClient.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface RagdollHumanoidOnDeathClient extends BaseObject {} + +export interface RagdollHumanoidOnDeathClientConstructor { + readonly ClassName: 'RagdollHumanoidOnDeathClient'; + new ( + humanoid: Humanoid, + serviceBag: ServiceBag + ): RagdollHumanoidOnDeathClient; + + disableParticleEmittersAndFadeOutYielding: ( + character: Model, + duration: number + ) => void; +} + +export const RagdollHumanoidOnDeathClient: Binder; diff --git a/src/ragdoll/src/Client/Classes/RagdollHumanoidOnFallClient.d.ts b/src/ragdoll/src/Client/Classes/RagdollHumanoidOnFallClient.d.ts new file mode 100644 index 00000000000..e4a5661819f --- /dev/null +++ b/src/ragdoll/src/Client/Classes/RagdollHumanoidOnFallClient.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { PromiseRemoteEventMixin } from '@quenty/remoting'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface RagdollHumanoidOnFallClient + extends BaseObject, + PromiseRemoteEventMixin {} + +export interface RagdollHumanoidOnFallClientConstructor { + readonly ClassName: 'RagdollHumanoidOnFallClient'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollHumanoidOnFallClient; +} + +export const RagdollHumanoidOnFallClient: Binder; diff --git a/src/ragdoll/src/Client/Classes/RagdollableClient.d.ts b/src/ragdoll/src/Client/Classes/RagdollableClient.d.ts new file mode 100644 index 00000000000..b487f886e01 --- /dev/null +++ b/src/ragdoll/src/Client/Classes/RagdollableClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { RagdollableBase } from '../../Shared/Classes/RagdollableBase'; + +export interface RagdollableClient extends RagdollableBase {} + +export interface RagdollableClientConstructor { + readonly ClassName: 'RagdollableClient'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollableClient; +} + +export const RagdollableClient: Binder; diff --git a/src/ragdoll/src/Client/RagdollBindersClient.d.ts b/src/ragdoll/src/Client/RagdollBindersClient.d.ts new file mode 100644 index 00000000000..305153c965e --- /dev/null +++ b/src/ragdoll/src/Client/RagdollBindersClient.d.ts @@ -0,0 +1,12 @@ +import { BinderProvider } from '@quenty/binder'; +import { RagdollClient } from './Classes/RagdollClient'; +import { RagdollableClient } from './Classes/RagdollableClient'; +import { RagdollHumanoidOnDeathClient } from './Classes/RagdollHumanoidOnDeathClient'; +import { RagdollHumanoidOnFallClient } from './Classes/RagdollHumanoidOnFallClient'; + +export const RagdollBindersClient: BinderProvider<{ + Ragdoll: RagdollClient; + Ragdollable: RagdollableClient; + RagdollHumanoidOnDeath: RagdollHumanoidOnDeathClient; + RagdollHumanoidOnFall: RagdollHumanoidOnFallClient; +}>; diff --git a/src/ragdoll/src/Client/RagdollServiceClient.d.ts b/src/ragdoll/src/Client/RagdollServiceClient.d.ts new file mode 100644 index 00000000000..0366d42aa0d --- /dev/null +++ b/src/ragdoll/src/Client/RagdollServiceClient.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface RagdollServiceClient { + readonly ServiceName: 'RagdollServiceClient'; + Init(serviceBag: ServiceBag): void; + SetScreenShakeEnabled(value: boolean): void; + GetScreenShakeEnabled(): boolean; +} diff --git a/src/ragdoll/src/Server/Classes/Ragdoll.d.ts b/src/ragdoll/src/Server/Classes/Ragdoll.d.ts new file mode 100644 index 00000000000..89222787d2c --- /dev/null +++ b/src/ragdoll/src/Server/Classes/Ragdoll.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { Binder } from '@quenty/binder'; +import { BaseObject } from '@quenty/baseobject'; + +interface Ragdoll extends BaseObject {} + +interface RagdollConstructor { + readonly ClassName: 'Ragdoll'; + new (humanoid: Humanoid, serviceBag: ServiceBag): Ragdoll; +} + +export const Ragdoll: Binder; diff --git a/src/ragdoll/src/Server/Classes/RagdollCameraShake.d.ts b/src/ragdoll/src/Server/Classes/RagdollCameraShake.d.ts new file mode 100644 index 00000000000..4e90c87b13d --- /dev/null +++ b/src/ragdoll/src/Server/Classes/RagdollCameraShake.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { BaseObject } from '@quenty/baseobject'; + +interface RagdollCameraShake extends BaseObject {} + +interface RagdollCameraShakeConstructor { + readonly ClassName: 'RagdollCameraShake'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollCameraShake; +} + +export const RagdollCameraShake: PlayerHumanoidBinder; diff --git a/src/ragdoll/src/Server/Classes/RagdollHumanoidOnDeath.d.ts b/src/ragdoll/src/Server/Classes/RagdollHumanoidOnDeath.d.ts new file mode 100644 index 00000000000..4e778a635dc --- /dev/null +++ b/src/ragdoll/src/Server/Classes/RagdollHumanoidOnDeath.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { BaseObject } from '@quenty/baseobject'; + +interface RagdollHumanoidOnDeath extends BaseObject {} + +interface RagdollHumanoidOnDeathConstructor { + readonly ClassName: 'RagdollHumanoidOnDeath'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollHumanoidOnDeath; +} + +export const RagdollHumanoidOnDeath: PlayerHumanoidBinder; diff --git a/src/ragdoll/src/Server/Classes/RagdollHumanoidOnFall.d.ts b/src/ragdoll/src/Server/Classes/RagdollHumanoidOnFall.d.ts new file mode 100644 index 00000000000..032132117d4 --- /dev/null +++ b/src/ragdoll/src/Server/Classes/RagdollHumanoidOnFall.d.ts @@ -0,0 +1,15 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; + +interface RagdollHumanoidOnFall extends BaseObject { + ObserveIsFalling(): Observable; +} + +interface RagdollHumanoidOnFallConstructor { + readonly ClassName: 'RagdollHumanoidOnFall'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RagdollHumanoidOnFall; +} + +export const RagdollHumanoidOnFall: PlayerHumanoidBinder; diff --git a/src/ragdoll/src/Server/Classes/Ragdollable.d.ts b/src/ragdoll/src/Server/Classes/Ragdollable.d.ts new file mode 100644 index 00000000000..84eaec16ed0 --- /dev/null +++ b/src/ragdoll/src/Server/Classes/Ragdollable.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RagdollableBase } from '../../Shared/Classes/RagdollableBase'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; + +interface Ragdollable extends RagdollableBase {} + +interface RagdollableConstructor { + readonly ClassName: 'Ragdollable'; + new (humanoid: Humanoid, serviceBag: ServiceBag): Ragdollable; +} + +export const Ragdollable: PlayerHumanoidBinder; diff --git a/src/ragdoll/src/Server/Classes/UnragdollAutomatically.d.ts b/src/ragdoll/src/Server/Classes/UnragdollAutomatically.d.ts new file mode 100644 index 00000000000..9b8e5d450cc --- /dev/null +++ b/src/ragdoll/src/Server/Classes/UnragdollAutomatically.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; +import { BaseObject } from '@quenty/baseobject'; + +interface UnragdollAutomatically extends BaseObject {} + +interface UnragdollAutomaticallyConstructor { + readonly ClassName: 'UnragdollAutomatically'; + new (humanoid: Humanoid, serviceBag: ServiceBag): UnragdollAutomatically; +} + +export const UnragdollAutomatically: PlayerHumanoidBinder; diff --git a/src/ragdoll/src/Server/Classes/UnragdollAutomaticallyConstants.d.ts b/src/ragdoll/src/Server/Classes/UnragdollAutomaticallyConstants.d.ts new file mode 100644 index 00000000000..fa7d67d10c5 --- /dev/null +++ b/src/ragdoll/src/Server/Classes/UnragdollAutomaticallyConstants.d.ts @@ -0,0 +1,4 @@ +export const UnragdollAutomaticallyConstants: Readonly<{ + UNRAGDOLL_AUTOMATICALLY_ATTRIBUTE: 'UnragdollAutomatically'; + UNRAGDOLL_AUTOMATIC_TIME_ATTRIBUTE: 'UnragdollAutomaticTime'; +}>; diff --git a/src/ragdoll/src/Server/RagdollBindersServer.d.ts b/src/ragdoll/src/Server/RagdollBindersServer.d.ts new file mode 100644 index 00000000000..3a4f035e93b --- /dev/null +++ b/src/ragdoll/src/Server/RagdollBindersServer.d.ts @@ -0,0 +1,14 @@ +import { BinderProvider } from '@quenty/binder'; +import { Ragdoll } from './Classes/Ragdoll'; +import { Ragdollable } from './Classes/Ragdollable'; +import { RagdollHumanoidOnDeath } from './Classes/RagdollHumanoidOnDeath'; +import { RagdollHumanoidOnFall } from './Classes/RagdollHumanoidOnFall'; +import { UnragdollAutomatically } from './Classes/UnragdollAutomatically'; + +export const RagdollBindersServer: BinderProvider<{ + Ragdoll: Ragdoll; + Ragdollable: Ragdollable; + RagdollHumanoidOnDeath: RagdollHumanoidOnDeath; + RagdollHumanoidOnFall: RagdollHumanoidOnFall; + UnragdollAutomatically: UnragdollAutomatically; +}>; diff --git a/src/ragdoll/src/Server/RagdollService.d.ts b/src/ragdoll/src/Server/RagdollService.d.ts new file mode 100644 index 00000000000..37d257b07fb --- /dev/null +++ b/src/ragdoll/src/Server/RagdollService.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface RagdollService { + readonly ServiceName: 'RagdollService'; + Init(serviceBag: ServiceBag): void; + SetRagdollOnFall(ragdollOnFall: boolean): void; + SetRagdollOnDeath(ragdollOnDeath: boolean): void; + SetUnragdollAutomatically(unragdollAutomatically: boolean): void; +} diff --git a/src/ragdoll/src/Shared/Classes/BindableRagdollHumanoidOnFall.d.ts b/src/ragdoll/src/Shared/Classes/BindableRagdollHumanoidOnFall.d.ts new file mode 100644 index 00000000000..f07fd59f3e6 --- /dev/null +++ b/src/ragdoll/src/Shared/Classes/BindableRagdollHumanoidOnFall.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Binder } from '@quenty/binder'; +import { ValueObject } from '@quenty/valueobject'; + +interface BindableRagdollHumanoidOnFall extends BaseObject { + ShouldRagdoll: ValueObject; + + ObserveIsFalling(): boolean; +} + +interface GuiTriangleConstructor { + readonly ClassName: 'BindableRagdollHumanoidOnFall'; + new ( + humanoid: Humanoid, + ragdollBinder: Binder + ): BindableRagdollHumanoidOnFall; +} + +export const BindableRagdollHumanoidOnFall: GuiTriangleConstructor; diff --git a/src/ragdoll/src/Shared/Classes/RagdollHumanoidOnFallConstants.d.ts b/src/ragdoll/src/Shared/Classes/RagdollHumanoidOnFallConstants.d.ts new file mode 100644 index 00000000000..a6fccf24694 --- /dev/null +++ b/src/ragdoll/src/Shared/Classes/RagdollHumanoidOnFallConstants.d.ts @@ -0,0 +1,3 @@ +export const RagdollHumanoidOnFallConstants: Readonly<{ + REMOTE_EVENT_NAME: 'RagdollHumanoidOnFallRemoteEvent'; +}>; diff --git a/src/ragdoll/src/Shared/Classes/RagdollableBase.d.ts b/src/ragdoll/src/Shared/Classes/RagdollableBase.d.ts new file mode 100644 index 00000000000..d229a1bdbe2 --- /dev/null +++ b/src/ragdoll/src/Shared/Classes/RagdollableBase.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { RxSignal } from '@quenty/rxsignal'; + +interface RagdollableBase extends BaseObject { + Ragdolled: RxSignal; + Unragdolled: RxSignal; + + Ragdoll(): void; + Unragdoll(): void; + ObserveIsRagdolled(): Observable; + IsRagdolled(): boolean; +} + +interface RagdollableBaseConstructor { + readonly ClassName: 'RagdollableBase'; + new (humanoid: Humanoid): RagdollableBase; +} + +export const RagdollableBase: RagdollableBaseConstructor; diff --git a/src/ragdoll/src/Shared/Interfaces/RagdollableInterface.d.ts b/src/ragdoll/src/Shared/Interfaces/RagdollableInterface.d.ts new file mode 100644 index 00000000000..5d8d2f55913 --- /dev/null +++ b/src/ragdoll/src/Shared/Interfaces/RagdollableInterface.d.ts @@ -0,0 +1,14 @@ +import { + TieDefinition, + TieDefinitionMethod, + TieDefinitionSignal, +} from '@quenty/tie'; + +export const RagdollableInterface: TieDefinition<{ + Ragdolled: TieDefinitionSignal; + Unragdolled: TieDefinitionSignal; + Ragdoll: TieDefinitionMethod; + Unragdoll: TieDefinitionMethod; + ObserveIsRagdolled: TieDefinitionMethod; + IsRagdolled: TieDefinitionMethod; +}>; diff --git a/src/ragdoll/src/Shared/RagdollServiceConstants.d.ts b/src/ragdoll/src/Shared/RagdollServiceConstants.d.ts new file mode 100644 index 00000000000..a12634558fd --- /dev/null +++ b/src/ragdoll/src/Shared/RagdollServiceConstants.d.ts @@ -0,0 +1,3 @@ +export const RagdollServiceConstants: Readonly<{ + SCREEN_SHAKE_ENABLED_ATTRIBUTE: 'RagdollScreenShakeEnabled'; +}>; diff --git a/src/ragdoll/src/Shared/Rigging/RagdollAdditionalAttachmentUtils.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollAdditionalAttachmentUtils.d.ts new file mode 100644 index 00000000000..00881a4b0b5 --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollAdditionalAttachmentUtils.d.ts @@ -0,0 +1,16 @@ +import { Maid } from '@quenty/maid'; + +export namespace RagdollAdditionalAttachmentUtils { + function getAdditionalAttachmentData( + rigType: Enum.HumanoidRigType + ): [ + limbName: string, + attachmentName: string, + cframe: CFrame, + otherAttachmentName?: string + ][]; + function ensureAdditionalAttachments( + character: Model, + rigType: Enum.HumanoidRigType + ): Maid; +} diff --git a/src/ragdoll/src/Shared/Rigging/RagdollBallSocketUtils.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollBallSocketUtils.d.ts new file mode 100644 index 00000000000..8e327d5805b --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollBallSocketUtils.d.ts @@ -0,0 +1,16 @@ +import { Maid } from '@quenty/maid'; + +export namespace RagdollBallSocketUtils { + function getRigData(rigType: Enum.HumanoidRigType): { + part0Name: string; + part1Name: string; + attachmentName: string; + motorParentName: string; + motorName: string; + limitData: any; + }[]; + function ensureBallSockets( + character: Model, + rigType: Enum.HumanoidRigType + ): Maid; +} diff --git a/src/ragdoll/src/Shared/Rigging/RagdollCollisionUtils.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollCollisionUtils.d.ts new file mode 100644 index 00000000000..3513e8b44f2 --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollCollisionUtils.d.ts @@ -0,0 +1,12 @@ +import { Maid } from '@quenty/maid'; + +export namespace RagdollCollisionUtils { + function getCollisionData( + rigType: Enum.HumanoidRigType + ): [part0Name: string, part1Name: string][]; + function preventCollisionAmongOthers(character: Model, part: BasePart): Maid; + function ensureNoCollides( + character: Model, + rigType: Enum.HumanoidRigType + ): Maid; +} diff --git a/src/ragdoll/src/Shared/Rigging/RagdollMotorData.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollMotorData.d.ts new file mode 100644 index 00000000000..fd09483f8d1 --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollMotorData.d.ts @@ -0,0 +1,6 @@ +import { AdorneeData } from '@quenty/adorneedata'; + +export const RagdollMotorData: AdorneeData<{ + IsMotorAnimated: boolean; + RagdollSpringReturnSpeed: number; +}>; diff --git a/src/ragdoll/src/Shared/Rigging/RagdollMotorLimitData.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollMotorLimitData.d.ts new file mode 100644 index 00000000000..d3ffa670680 --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollMotorLimitData.d.ts @@ -0,0 +1,25 @@ +import { AdorneeData } from '@quenty/adorneedata'; + +export type MotorLimitData = { + UpperAngle: number; + TwistLowerAngle: number; + TwistUpperAngle: number; + FrictionTorque: number; + ReferenceGravity: number; + ReferenceMass: number; +}; + +export const RagdollMotorLimitData: Readonly<{ + NECK_LIMITS: AdorneeData; + WASIT_LIMITS: AdorneeData; + ANKLE_LIMITS: AdorneeData; + ELBOW_LIMITS: AdorneeData; + WRIST_LIMITS: AdorneeData; + KNEE_LIMITS: AdorneeData; + SHOULDER_LIMITS: AdorneeData; + HIP_LIMITS: AdorneeData; + + R6_NECK_LIMITS: AdorneeData; + R6_SHOULDER_LIMITS: AdorneeData; + R6_HIP_LIMITS: AdorneeData; +}>; diff --git a/src/ragdoll/src/Shared/Rigging/RagdollMotorUtils.d.ts b/src/ragdoll/src/Shared/Rigging/RagdollMotorUtils.d.ts new file mode 100644 index 00000000000..27fe31d283a --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RagdollMotorUtils.d.ts @@ -0,0 +1,45 @@ +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; + +type MotorData = { + partName: string; + motorNam: string; + isRootJoint?: boolean; +}; + +export namespace RagdollMotorUtils { + function getFirstRootJointData(rigType: Enum.HumanoidRigType): MotorData; + function getMotorData(rigType: Enum.HumanoidRigType): MotorData[]; + function initMotorAttributes( + character: Model, + rigType: Enum.HumanoidRigType + ): void; + function setupAnimatedMotor(character: Model, part: BasePart): Maid; + function setupRagdollRootPartMotor( + motor: Motor6D, + part0: BasePart, + part1: BasePart + ): Maid; + function setupRagdollMotor( + motor: Motor6D, + part0: BasePart, + part1: BasePart + ): Maid; + function suppressJustRootPart( + character: Model, + rigType: Enum.HumanoidRigType + ): Maid; + function suppressMotors( + character: Model, + rigType: Enum.HumanoidRigType + ): Maid; + function guessIfNetworkOwner(part: BasePart): boolean; + function promiseVelocityRecordings( + character: Model, + rigType: Enum.HumanoidRigType + ): Promise<{ + readingTimePhysics: number; + linear: Map; + rotation: Map; + }>; +} diff --git a/src/ragdoll/src/Shared/Rigging/RxRagdollUtils.d.ts b/src/ragdoll/src/Shared/Rigging/RxRagdollUtils.d.ts new file mode 100644 index 00000000000..f6bab7bba12 --- /dev/null +++ b/src/ragdoll/src/Shared/Rigging/RxRagdollUtils.d.ts @@ -0,0 +1,16 @@ +import { Maid } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; + +export namespace RxRagdollUtils { + function observeRigType(humanoid: Humanoid): Observable; + function observeCharacterBrio(humanoid: Humanoid): Observable; + function suppressRootPartCollision(character: Model): Maid; + function enforceHeadCollision(character: Model): Maid; + function enforceHumanoidStateMachineOff( + character: Model, + humanoid: Humanoid + ): Maid; + function enforceLimbCollisions(character: Model): Maid; + function runLocal(humanoid: Humanoid): Maid; + function enforceHumanoidState(humanoid: Humanoid): Maid; +} diff --git a/src/randomutils/index.d.ts b/src/randomutils/index.d.ts new file mode 100644 index 00000000000..700f1a25b54 --- /dev/null +++ b/src/randomutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/RandomSampler'; +export * from './src/Shared/RandomUtils'; +export * from './src/Shared/WeightedRandomChooser'; diff --git a/src/randomutils/src/Shared/RandomSampler.d.ts b/src/randomutils/src/Shared/RandomSampler.d.ts new file mode 100644 index 00000000000..e9f065fc4a3 --- /dev/null +++ b/src/randomutils/src/Shared/RandomSampler.d.ts @@ -0,0 +1,12 @@ +interface RandomSampler { + SetSamples(samples: T[]): void; + Sample(): T; + Refill(): void; +} + +interface RandomSamplerConstructor { + readonly ClassName: 'RandomSampler'; + new (samples: T[]): RandomSampler; +} + +export const RandomSampler: RandomSamplerConstructor; diff --git a/src/randomutils/src/Shared/RandomUtils.d.ts b/src/randomutils/src/Shared/RandomUtils.d.ts new file mode 100644 index 00000000000..d7839899365 --- /dev/null +++ b/src/randomutils/src/Shared/RandomUtils.d.ts @@ -0,0 +1,8 @@ +export namespace RandomUtils { + function choice(array: T[], random?: Random): T | undefined; + function shuffledCopy(array: T[], random?: Random): T[]; + function shuffle(list: T[], random?: Random): void; + function weightedChoice(list: T[], random?: Random): T | undefined; + function gaussianRandom(random?: Random): number; + function randomUnitVector3(random?: Random): Vector3; +} diff --git a/src/randomutils/src/Shared/WeightedRandomChooser.d.ts b/src/randomutils/src/Shared/WeightedRandomChooser.d.ts new file mode 100644 index 00000000000..fbd20d7b77c --- /dev/null +++ b/src/randomutils/src/Shared/WeightedRandomChooser.d.ts @@ -0,0 +1,15 @@ +interface WeightedRandomChooser { + SetWeight(option: T, weight: number | undefined): void; + Remove(option: T): void; + GetWeight(option: T): number | undefined; + GetProbability(option: T): number | undefined; + Choose(random?: Random): T; +} + +interface WeightedRandomChooserConstructor { + readonly ClassName: 'WeightedRandomChooser'; + new (): WeightedRandomChooser; + new (): WeightedRandomChooser; +} + +export const WeightedRandomChooser: WeightedRandomChooserConstructor; diff --git a/src/raycaster/index.d.ts b/src/raycaster/index.d.ts new file mode 100644 index 00000000000..ec3bc92318b --- /dev/null +++ b/src/raycaster/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Raycaster'; +export * from './src/Shared/RaycastUtils'; diff --git a/src/raycaster/src/Shared/RaycastUtils.d.ts b/src/raycaster/src/Shared/RaycastUtils.d.ts new file mode 100644 index 00000000000..af143c839ae --- /dev/null +++ b/src/raycaster/src/Shared/RaycastUtils.d.ts @@ -0,0 +1,16 @@ +export namespace RaycastUtils { + function raycastSingleExit( + origin: Vector3, + direction: Vector3, + part: BasePart + ): RaycastResult | undefined; + function ignoreCanCollideFalse(part: BasePart): boolean; + function raycast( + origin: Vector3, + direction: Vector3, + ignoreListWorkingEnvironment: Instance[], + ignoreFunc: (raycastResult: RaycastResult) => boolean, + keepIgnoreListChanges?: boolean, + ignoreWater?: boolean + ): RaycastResult | undefined; +} diff --git a/src/raycaster/src/Shared/Raycaster.d.ts b/src/raycaster/src/Shared/Raycaster.d.ts new file mode 100644 index 00000000000..ff40a5be63a --- /dev/null +++ b/src/raycaster/src/Shared/Raycaster.d.ts @@ -0,0 +1,16 @@ +interface Raycaster { + readonly IgnoreList: Instance[]; + Filter: (raycastResult: RaycastResult) => boolean; + IgnoreWater: boolean; + MaxCasts: number; + + Ignore(tableOrInstance: Instance | Instance[]): void; + FindPartOnRay(ray: Ray): RaycastResult | undefined; +} + +interface RaycasterConstructor { + readonly ClassName: 'Raycaster'; + new (doIgnoreFunction?: (raycastResult: RaycastResult) => boolean): Raycaster; +} + +export const Raycaster: RaycasterConstructor; diff --git a/src/rbxasset/index.d.ts b/src/rbxasset/index.d.ts new file mode 100644 index 00000000000..a5cc239c0cb --- /dev/null +++ b/src/rbxasset/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RbxAssetUtils'; diff --git a/src/rbxasset/src/Shared/RbxAssetUtils.d.ts b/src/rbxasset/src/Shared/RbxAssetUtils.d.ts new file mode 100644 index 00000000000..21609c5a208 --- /dev/null +++ b/src/rbxasset/src/Shared/RbxAssetUtils.d.ts @@ -0,0 +1,6 @@ +export namespace RbxAssetUtils { + function toRbxAssetId(id: string | number): string; + function isConvertableToRbxAsset( + id: string | number | undefined + ): id is string | number; +} diff --git a/src/rbxthumb/index.d.ts b/src/rbxthumb/index.d.ts new file mode 100644 index 00000000000..d5636b52a5d --- /dev/null +++ b/src/rbxthumb/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RbxThumbUtils'; +export * from './src/Shared/RbxThumbnailTypes'; diff --git a/src/rbxthumb/src/Shared/RbxThumbUtils.d.ts b/src/rbxthumb/src/Shared/RbxThumbUtils.d.ts new file mode 100644 index 00000000000..8fd4c5cf6d5 --- /dev/null +++ b/src/rbxthumb/src/Shared/RbxThumbUtils.d.ts @@ -0,0 +1,58 @@ +import { RbxThumbnailTypes } from './RbxThumbnailTypes'; + +export namespace RbxThumbUtils { + function getThumbnailUrl( + thumbnailType: (typeof RbxThumbnailTypes)[keyof typeof RbxThumbnailTypes], + targetId: number, + width: number, + height: number + ): string; + function avatarItemTypeToThumbnailType( + avatarItemType: Enum.AvatarItemType + ): 'Asset' | 'BundleThumbnail'; + function getAssetThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getAvatarThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getAvatarHeadShotThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getBadgeIconThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getBundleThumbnailThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getGameIconThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getGamePassThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getGroupIconThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; + function getOutfitThumbnailUrl( + targetId: number, + width?: number, + height?: number + ): string; +} diff --git a/src/rbxthumb/src/Shared/RbxThumbnailTypes.d.ts b/src/rbxthumb/src/Shared/RbxThumbnailTypes.d.ts new file mode 100644 index 00000000000..2a45815a02c --- /dev/null +++ b/src/rbxthumb/src/Shared/RbxThumbnailTypes.d.ts @@ -0,0 +1,11 @@ +export const RbxThumbnailTypes: Readonly<{ + ASSET: 'Asset'; + AVATAR: 'Avatar'; + AVATAR_HEAD_SHOT: 'AvatarHeadShot'; + BADGE: 'BadgeIcon'; + BUNDLE: 'BundleThumbnail'; + GAME_ICON: 'GameIcon'; + GAME_PASS: 'GamePass'; + GROUP_ICON: 'GroupIcon'; + OUTFIT: 'Outfit'; +}>; diff --git a/src/receiptprocessing/index.d.ts b/src/receiptprocessing/index.d.ts new file mode 100644 index 00000000000..83bc2d20a4d --- /dev/null +++ b/src/receiptprocessing/index.d.ts @@ -0,0 +1 @@ +export * from './src/Server/ReceiptProcessingService'; diff --git a/src/receiptprocessing/src/Server/ReceiptProcessingService.d.ts b/src/receiptprocessing/src/Server/ReceiptProcessingService.d.ts new file mode 100644 index 00000000000..ca81abf8334 --- /dev/null +++ b/src/receiptprocessing/src/Server/ReceiptProcessingService.d.ts @@ -0,0 +1,23 @@ +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface ReceiptProcessingService { + readonly ServiceName: 'ReceiptProcessingService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + SetDefaultPurchaseDecision( + productPurchaseDecision: Enum.ProductPurchaseDecision + ): void; + ObserveReceiptProcessedForPlayer(player: Player): Observable; + ObserveReceiptProcessedForUserId(userId: number): Observable; + RegisterReceiptProcessor( + processor: ( + receiptInfo: ReceiptInfo + ) => + | Enum.ProductPurchaseDecision + | Promise + | undefined, + priority?: number + ): () => void; + Destroy(): void; +} diff --git a/src/rectutils/index.d.ts b/src/rectutils/index.d.ts new file mode 100644 index 00000000000..bb2c245dfc9 --- /dev/null +++ b/src/rectutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RectUtils'; diff --git a/src/rectutils/src/Shared/RectUtils.d.ts b/src/rectutils/src/Shared/RectUtils.d.ts new file mode 100644 index 00000000000..048cf3744a8 --- /dev/null +++ b/src/rectutils/src/Shared/RectUtils.d.ts @@ -0,0 +1,3 @@ +export namespace RectUtils { + function contains(rect: Rect, position: Vector2): boolean; +} diff --git a/src/region3int16utils/index.d.ts b/src/region3int16utils/index.d.ts new file mode 100644 index 00000000000..f4eccd2a37a --- /dev/null +++ b/src/region3int16utils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Region3int16Utils'; diff --git a/src/region3int16utils/src/Shared/Region3int16Utils.d.ts b/src/region3int16utils/src/Shared/Region3int16Utils.d.ts new file mode 100644 index 00000000000..cf7b5bf4384 --- /dev/null +++ b/src/region3int16utils/src/Shared/Region3int16Utils.d.ts @@ -0,0 +1,7 @@ +export namespace Region3int16Utils { + function createRegion3int16FromPositionSize( + position: Vector3, + size: Vector3 + ): Region3int16; + function fromRegion3(region3: Region3): Region3int16; +} diff --git a/src/region3utils/index.d.ts b/src/region3utils/index.d.ts new file mode 100644 index 00000000000..1a0a419f085 --- /dev/null +++ b/src/region3utils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Region3Utils'; diff --git a/src/region3utils/src/Shared/Region3Utils.d.ts b/src/region3utils/src/Shared/Region3Utils.d.ts new file mode 100644 index 00000000000..d05c24ebaff --- /dev/null +++ b/src/region3utils/src/Shared/Region3Utils.d.ts @@ -0,0 +1,5 @@ +export namespace Region3Utils { + function fromPositionSize(position: Vector3, size: Vector3): Region3; + function fromBox(cframe: CFrame, size: Vector3): Region3; + function fromRadius(position: Vector3, radius: number): Region3; +} diff --git a/src/remotefunctionutils/index.d.ts b/src/remotefunctionutils/index.d.ts new file mode 100644 index 00000000000..915521e0bae --- /dev/null +++ b/src/remotefunctionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RemoteFunctionUtils'; diff --git a/src/remotefunctionutils/src/Shared/RemoteFunctionUtils.d.ts b/src/remotefunctionutils/src/Shared/RemoteFunctionUtils.d.ts new file mode 100644 index 00000000000..6f9eb5ce82b --- /dev/null +++ b/src/remotefunctionutils/src/Shared/RemoteFunctionUtils.d.ts @@ -0,0 +1,21 @@ +import { Promise } from '@quenty/promise'; + +export namespace RemoteFunctionUtils { + function promiseInvokeServer( + remoteFunction: RemoteFunction, + ...args: unknown[] + ): Promise; + function promiseInvokeClient( + remoteFunction: RemoteFunction, + player: Player, + ...args: unknown[] + ): Promise; + function promiseInvokeBindableFunction( + bindableFunction: BindableFunction, + ...args: unknown[] + ): Promise; + function fromPromiseYieldResult( + ok: boolean, + ...args: T + ): T | Promise; +} diff --git a/src/remoting/index.d.ts b/src/remoting/index.d.ts new file mode 100644 index 00000000000..26c37d5f1db --- /dev/null +++ b/src/remoting/index.d.ts @@ -0,0 +1,11 @@ +export * from './src/Shared/GetRemoteEvent'; +export * from './src/Shared/GetRemoteFunction'; +export * from './src/Shared/Interface/Remoting'; +export * from './src/Shared/Interface/RemotingMember'; +export * from './src/Shared/PromiseGetRemoteEvent'; +export * from './src/Shared/PromiseGetRemoteFunction'; +export * from './src/Shared/PromiseRemoteEventMixin'; +export * from './src/Shared/PromiseRemoteFunctionMixin'; +export * from './src/Shared/Realm/RemotingRealmUtils'; +export * from './src/Shared/Realm/RemotingRealms'; +export * from './src/Shared/ResourceConstants'; diff --git a/src/remoting/src/Shared/GetRemoteEvent.d.ts b/src/remoting/src/Shared/GetRemoteEvent.d.ts new file mode 100644 index 00000000000..ff281c44843 --- /dev/null +++ b/src/remoting/src/Shared/GetRemoteEvent.d.ts @@ -0,0 +1 @@ +export function GetRemoteEvent(name: string): RemoteEvent; diff --git a/src/remoting/src/Shared/GetRemoteFunction.d.ts b/src/remoting/src/Shared/GetRemoteFunction.d.ts new file mode 100644 index 00000000000..02a5dcc9d8e --- /dev/null +++ b/src/remoting/src/Shared/GetRemoteFunction.d.ts @@ -0,0 +1 @@ +export function GetRemoteFunction(name: string): RemoteFunction; diff --git a/src/remoting/src/Shared/Interface/Remoting.d.ts b/src/remoting/src/Shared/Interface/Remoting.d.ts new file mode 100644 index 00000000000..bbaeaf252ce --- /dev/null +++ b/src/remoting/src/Shared/Interface/Remoting.d.ts @@ -0,0 +1,45 @@ +import { Maid } from '@quenty/maid'; +import { RemotingRealm } from '../Realm/RemotingRealms'; +import { RemotingMember } from './RemotingMember'; + +type Remoting = { + Connect(memberName: string, callback: (...args: unknown[]) => void): Maid; + Bind(memberName: string, callback: (...args: unknown[]) => unknown): Maid; + DeclareEvent(memberName: string): void; + DeclareMethod(memberName: string): void; + FireClient(memberName: string, player: Player, ...args: unknown[]): void; + InvokeClient(memberName: string, player: Player, ...args: unknown[]): unknown; + FireAllClients(memberName: string, ...args: unknown[]): void; + FireAllClientsExcept( + memberName: string, + excludePlayer: Player, + ...args: unknown[] + ): void; + FireServer(memberName: string, ...args: unknown[]): void; + PromiseFireServer( + memberName: string, + ...args: unknown[] + ): Promise; + InvokeServer(memberName: string, ...args: unknown[]): unknown; + PromiseInvokeServer(memberName: string, ...args: unknown[]): Promise; + PromiseInvokeClient( + memberName: string, + player: Player, + ...args: unknown[] + ): Promise; + GetContainerClass(): string; + Destroy(): void; +} & { + [memberName: string]: RemotingMember; +}; + +interface RemotingConstructor { + readonly ClassName: 'Remoting'; + new ( + instance: Instance, + name: string, + remotingRealm?: RemotingRealm + ): Remoting; +} + +export const Remoting: RemotingConstructor; diff --git a/src/remoting/src/Shared/Interface/RemotingMember.d.ts b/src/remoting/src/Shared/Interface/RemotingMember.d.ts new file mode 100644 index 00000000000..499bd3e7cec --- /dev/null +++ b/src/remoting/src/Shared/Interface/RemotingMember.d.ts @@ -0,0 +1,31 @@ +import { Maid } from '@quenty/maid'; +import { RemotingRealm } from '../Realm/RemotingRealms'; +import { Promise } from '@quenty/promise'; +import { Remoting } from './Remoting'; + +interface RemotingMember { + Bind(callback: (...args: unknown[]) => unknown): Maid; + Connect(callback: (...args: unknown[]) => void): Maid; + DeclareEvent(): void; + DeclareMethod(): void; + FireServer(...args: unknown[]): void; + InvokeServer(...args: unknown[]): unknown; + PromiseInvokeServer(...args: unknown[]): Promise; + PromiseFireServer(...args: unknown[]): Promise; + PromiseInvokeClient(player: Player, ...args: unknown[]): Promise; + InvokeClient(player: Player, ...args: unknown[]): void; + FireAllClients(...args: unknown[]): void; + FireAllClientsExcept(excludePlayer: Player, ...args: unknown[]): void; + FireClient(player: Player, ...args: unknown[]): void; +} + +interface RemotingMemberConstructor { + readonly ClassName: 'RemotingMember'; + new ( + remoting: Remoting, + memberName: string, + remotingRealm: RemotingRealm + ): RemotingMember; +} + +export const RemotingMember: RemotingMemberConstructor; diff --git a/src/remoting/src/Shared/PromiseGetRemoteEvent.d.ts b/src/remoting/src/Shared/PromiseGetRemoteEvent.d.ts new file mode 100644 index 00000000000..174f5412b11 --- /dev/null +++ b/src/remoting/src/Shared/PromiseGetRemoteEvent.d.ts @@ -0,0 +1 @@ +export function PromiseGetRemoteEvent(name: string): Promise; diff --git a/src/remoting/src/Shared/PromiseGetRemoteFunction.d.ts b/src/remoting/src/Shared/PromiseGetRemoteFunction.d.ts new file mode 100644 index 00000000000..c13e2d9873b --- /dev/null +++ b/src/remoting/src/Shared/PromiseGetRemoteFunction.d.ts @@ -0,0 +1 @@ +export function PromiseGetRemoteFunction(name: string): Promise; diff --git a/src/remoting/src/Shared/PromiseRemoteEventMixin.d.ts b/src/remoting/src/Shared/PromiseRemoteEventMixin.d.ts new file mode 100644 index 00000000000..1f11eeaae4e --- /dev/null +++ b/src/remoting/src/Shared/PromiseRemoteEventMixin.d.ts @@ -0,0 +1,12 @@ +import { Promise } from '@quenty/promise'; + +export interface PromiseRemoteEventMixin { + PromiseRemoteEvent(): Promise; +} + +export const PromiseRemoteEventMixin: { + Add( + classObj: { new (...args: unknown[]): unknown }, + remoteEventName: string + ): void; +}; diff --git a/src/remoting/src/Shared/PromiseRemoteFunctionMixin.d.ts b/src/remoting/src/Shared/PromiseRemoteFunctionMixin.d.ts new file mode 100644 index 00000000000..bc72dac2ce4 --- /dev/null +++ b/src/remoting/src/Shared/PromiseRemoteFunctionMixin.d.ts @@ -0,0 +1,12 @@ +import { Promise } from '@quenty/promise'; + +export interface PromiseRemoteFunctionMixin { + PromiseRemoteFunction(): Promise; +} + +export const PromiseRemoteFunctionMixin: { + Add( + classObj: { new (...args: unknown[]): unknown }, + remoteFunctionName: string + ): void; +}; diff --git a/src/remoting/src/Shared/Realm/RemotingRealmUtils.d.ts b/src/remoting/src/Shared/Realm/RemotingRealmUtils.d.ts new file mode 100644 index 00000000000..344de6ef5ef --- /dev/null +++ b/src/remoting/src/Shared/Realm/RemotingRealmUtils.d.ts @@ -0,0 +1,6 @@ +import { RemotingRealm } from './RemotingRealms'; + +export namespace RemotingRealmUtils { + function isRemotingRealm(value: unknown): value is RemotingRealm; + function inferRemotingRealm(): RemotingRealm; +} diff --git a/src/remoting/src/Shared/Realm/RemotingRealms.d.ts b/src/remoting/src/Shared/Realm/RemotingRealms.d.ts new file mode 100644 index 00000000000..59b9fed87e7 --- /dev/null +++ b/src/remoting/src/Shared/Realm/RemotingRealms.d.ts @@ -0,0 +1,6 @@ +export type RemotingRealm = 'server' | 'client'; + +export const RemotingRealms: Readonly<{ + SERVER: 'server'; + CLIENT: 'client'; +}>; diff --git a/src/remoting/src/Shared/ResourceConstants.d.ts b/src/remoting/src/Shared/ResourceConstants.d.ts new file mode 100644 index 00000000000..9ed85218677 --- /dev/null +++ b/src/remoting/src/Shared/ResourceConstants.d.ts @@ -0,0 +1,4 @@ +export const ResourceConstants: { + readonly REMOTE_EVENT_FOLDER_NAME: 'RemoteEvents'; + readonly REMOTE_FUNCTION_FOLDER_NAME: 'RemoteFunctions'; +}; diff --git a/src/resetservice/index.d.ts b/src/resetservice/index.d.ts new file mode 100644 index 00000000000..62fe1e346ba --- /dev/null +++ b/src/resetservice/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/ResetServiceClient'; +export * from './src/Server/ResetService'; diff --git a/src/resetservice/src/Client/ResetServiceClient.d.ts b/src/resetservice/src/Client/ResetServiceClient.d.ts new file mode 100644 index 00000000000..560baf4f10d --- /dev/null +++ b/src/resetservice/src/Client/ResetServiceClient.d.ts @@ -0,0 +1,8 @@ +import { Promise } from '@quenty/promise'; + +export interface ResetServiceClient { + readonly ServiceName: 'ResetServiceClient'; + Init(): void; + PromiseResetCharacter(): Promise; + Destroy(): void; +} diff --git a/src/resetservice/src/Server/ResetService.d.ts b/src/resetservice/src/Server/ResetService.d.ts new file mode 100644 index 00000000000..93d13ba1837 --- /dev/null +++ b/src/resetservice/src/Server/ResetService.d.ts @@ -0,0 +1,9 @@ +import { Promise } from '@quenty/promise'; + +export interface ResetService { + readonly ServiceName: 'ResetService'; + Init(): void; + PushResetProvider(promiseReset: (player: Player) => Promise): () => void; + PromiseResetCharacter(player: Player): Promise; + Destroy(): void; +} diff --git a/src/richtext/index.d.ts b/src/richtext/index.d.ts new file mode 100644 index 00000000000..fc186cc6ebd --- /dev/null +++ b/src/richtext/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RichTextUtils'; diff --git a/src/richtext/src/Shared/RichTextUtils.d.ts b/src/richtext/src/Shared/RichTextUtils.d.ts new file mode 100644 index 00000000000..76e82efb70f --- /dev/null +++ b/src/richtext/src/Shared/RichTextUtils.d.ts @@ -0,0 +1,4 @@ +export namespace RichTextUtils { + function sanitizeRichText(text: string): string; + function removeRichTextEncoding(text: string): string; +} diff --git a/src/rigbuilderutils/index.d.ts b/src/rigbuilderutils/index.d.ts new file mode 100644 index 00000000000..ca1f0efd5c2 --- /dev/null +++ b/src/rigbuilderutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RigBuilderUtils'; diff --git a/src/rigbuilderutils/src/Shared/RigBuilderUtils.d.ts b/src/rigbuilderutils/src/Shared/RigBuilderUtils.d.ts new file mode 100644 index 00000000000..bef9dacea4c --- /dev/null +++ b/src/rigbuilderutils/src/Shared/RigBuilderUtils.d.ts @@ -0,0 +1,31 @@ +import { Promise } from '@quenty/promise'; + +export namespace RigBuilderUtils { + function disableAnimateScript(rig: Model): void; + function findAnimateScript(rig: Model): LocalScript | Script | undefined; + function createR6BaseRig(): Model; + function createR6MeshRig(): Model; + function createR6MeshBoyRig(): Model; + function createR6MeshGirlRig(): Model; + function promiseR15PackageRig(packageAssetId: number): Promise; + function promiseR15Rig(): Promise; + function promiseR15ManRig(): Promise; + function promiseR15WomanRig(): Promise; + function promiseR15MeshRig(): Promise; + function promiseBasePlayerRig( + userId: number, + humanoidRigType?: Enum.HumanoidRigType, + assetTypeVerification?: Enum.AssetTypeVerification + ): Promise; + function promiseHumanoidModelFromDescription( + description: HumanoidDescription, + rigType?: Enum.HumanoidRigType, + assetTypeVerification?: Enum.AssetTypeVerification + ): Promise; + function promiseHumanoidModelFromUserId( + userId: number, + rigType?: Enum.HumanoidRigType, + assetTypeVerification?: Enum.AssetTypeVerification + ): Promise; + function promisePlayerRig(userId: number): Promise; +} diff --git a/src/roblox-api-dump/index.d.ts b/src/roblox-api-dump/index.d.ts new file mode 100644 index 00000000000..5116594714e --- /dev/null +++ b/src/roblox-api-dump/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Server/RobloxApiClass'; +export * from './src/Server/RobloxApiDump'; +export * from './src/Server/RobloxApiDumpConstants'; +export * from './src/Server/RobloxApiMember'; +export * from './src/Server/RobloxApiUtils'; diff --git a/src/roblox-api-dump/src/Server/RobloxApiClass.d.ts b/src/roblox-api-dump/src/Server/RobloxApiClass.d.ts new file mode 100644 index 00000000000..62f0ae19669 --- /dev/null +++ b/src/roblox-api-dump/src/Server/RobloxApiClass.d.ts @@ -0,0 +1,38 @@ +import { Promise } from '@quenty/promise'; +import { RobloxApiMember, RobloxApiMemberData } from './RobloxApiMember'; +import { RobloxApiDump } from './RobloxApiDump'; + +export interface RobloxApiClassData { + Members: RobloxApiMemberData[]; + MemoryCategory: string; + Name: string; + Superclass: string; + Tags: string[]; +} + +interface RobloxApiClass { + GetRawData(): RobloxApiClassData; + GetClassName(): string; + GetMemberCategory(): string | undefined; + PromiseSuperClass(): Promise; + PromiseIsA(className: string): Promise; + PromiseIsDescendantOf(className: string): Promise; + PromiseAllSuperClasses(): Promise; + GetSuperClassName(): string | undefined; + HasSuperClass(): boolean; + PromiseMembers(): Promise; + PromiseProperties(): Promise; + PromiseEvents(): Promise; + PromiseFunctions(): Promise; + IsService(): boolean; + IsNotCreatable(): boolean; + IsNotReplicated(): boolean; + HasTag(tagName: string): boolean; +} + +interface RobloxApiClassConstructor { + readonly ClassName: 'RobloxApiClass'; + new (robloxApiDump: RobloxApiDump, data: RobloxApiClassData): RobloxApiClass; +} + +export const RobloxApiClass: RobloxApiClassConstructor; diff --git a/src/roblox-api-dump/src/Server/RobloxApiDump.d.ts b/src/roblox-api-dump/src/Server/RobloxApiDump.d.ts new file mode 100644 index 00000000000..337c1cdcc40 --- /dev/null +++ b/src/roblox-api-dump/src/Server/RobloxApiDump.d.ts @@ -0,0 +1,23 @@ +import { BaseObject } from '@quenty/baseobject'; +import { RobloxApiClass, RobloxApiClassData } from './RobloxApiClass'; +import { RobloxApiEnumData } from './RobloxApiUtils'; +import { Promise } from '@quenty/promise'; +import { RobloxApiMember } from './RobloxApiMember'; + +export interface RobloxApiDumpData { + Classes: RobloxApiClassData[]; + Enums: RobloxApiEnumData[]; + Version: number; +} + +interface RobloxApiDump extends BaseObject { + PromiseClass(className: string): Promise; + PromiseMembers(className: string): Promise; +} + +interface RobloxApiDumpConstructor { + readonly ClassName: 'RobloxApiDump'; + new (): RobloxApiDump; +} + +export const RobloxApiDump: RobloxApiDumpConstructor; diff --git a/src/roblox-api-dump/src/Server/RobloxApiDumpConstants.d.ts b/src/roblox-api-dump/src/Server/RobloxApiDumpConstants.d.ts new file mode 100644 index 00000000000..a69198ebaf0 --- /dev/null +++ b/src/roblox-api-dump/src/Server/RobloxApiDumpConstants.d.ts @@ -0,0 +1,3 @@ +export const RobloxApiDumpConstants: Readonly<{ + ROOT_CLASS_NAME: '<<>>'; +}>; diff --git a/src/roblox-api-dump/src/Server/RobloxApiMember.d.ts b/src/roblox-api-dump/src/Server/RobloxApiMember.d.ts new file mode 100644 index 00000000000..73f21da3626 --- /dev/null +++ b/src/roblox-api-dump/src/Server/RobloxApiMember.d.ts @@ -0,0 +1,56 @@ +export interface RobloxApiMemberData { + Category: string; + MemberType: string; + Name: string; + Security: { + Read: string; + Write: string; + }; + Serialization: { + CanLoad: boolean; + CanSave: boolean; + }; + Tags: string[]; + ThreadSafety: string; + ValueType: { + Category: string; + Name: string; + }; +} + +interface RobloxApiMember { + GetTypeName(): string | undefined; + GetName(): string; + GetCategory(): string; + IsReadOnly(): boolean; + GetMemberType(): string; + IsEvent(): boolean; + GetRawData(): Readonly; + IsWriteNotAccessibleSecurity(): boolean; + IsReadNotAccessibleSecurity(): boolean; + IsWriteLocalUserSecurity(): boolean; + IsReadLocalUserSecurity(): boolean; + IsReadRobloxScriptSecurity(): boolean; + IsWriteRobloxScriptSecurity(): boolean; + IsWriteRobloxSecurity(): boolean; + CanSerializeSave(): boolean | undefined; + CanSerializeLoad(): boolean | undefined; + GetWriteSecurity(): string | undefined; + GetReadSecurity(): string | undefined; + IsProperty(): boolean; + IsFunction(): boolean; + IsCallback(): boolean; + IsNotScriptable(): boolean; + IsNotReplicated(): boolean; + IsDeprecated(): boolean; + IsHidden(): boolean; + GetTags(): readonly string[]; + HasTag(tagName: string): boolean; +} + +interface RobloxApiMemberConstructor { + readonly ClassName: 'RobloxApiMember'; + new (data: RobloxApiMemberData): RobloxApiMember; +} + +export const RobloxApiMember: RobloxApiMemberConstructor; diff --git a/src/roblox-api-dump/src/Server/RobloxApiUtils.d.ts b/src/roblox-api-dump/src/Server/RobloxApiUtils.d.ts new file mode 100644 index 00000000000..a088827922d --- /dev/null +++ b/src/roblox-api-dump/src/Server/RobloxApiUtils.d.ts @@ -0,0 +1,14 @@ +import { Promise } from '@quenty/promise'; +import { RobloxApiDumpData } from './RobloxApiDump'; + +export interface RobloxApiEnumData { + Name: string; + Items: { + Name: string; + Value: number; + }[]; +} + +export namespace RobloxApiUtils { + function promiseDump(): Promise; +} diff --git a/src/roblox/index.d.ts b/src/roblox/index.d.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/roblox/index.d.ts-api-dump b/src/roblox/index.d.ts-api-dump new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rodux-actions/index.d.ts b/src/rodux-actions/index.d.ts new file mode 100644 index 00000000000..e12a6a64cc0 --- /dev/null +++ b/src/rodux-actions/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RoduxActionFactory'; +export * from './src/Shared/RoduxActions'; diff --git a/src/rodux-actions/src/Shared/RoduxActionFactory.d.ts b/src/rodux-actions/src/Shared/RoduxActionFactory.d.ts new file mode 100644 index 00000000000..fac2a8137c4 --- /dev/null +++ b/src/rodux-actions/src/Shared/RoduxActionFactory.d.ts @@ -0,0 +1,19 @@ +interface RoduxActionFactory { + GetType(): string; + __call(...args: unknown[]): unknown; + CreateDispatcher(dispatch: () => void): (...args: unknown[]) => unknown; + Create(action: Record): unknown; + Validate(action: Record): boolean; + Is(action: Record): boolean; + IsApplicable(action: Record): boolean; +} + +interface RoduxActionFactoryConstructor { + readonly ClassName: 'RoduxActionFactory'; + new ( + actionName: string, + typeTable: Record boolean> + ): RoduxActionFactory; +} + +export const RoduxActionFactory: RoduxActionFactoryConstructor; diff --git a/src/rodux-actions/src/Shared/RoduxActions.d.ts b/src/rodux-actions/src/Shared/RoduxActions.d.ts new file mode 100644 index 00000000000..ff829ac6bef --- /dev/null +++ b/src/rodux-actions/src/Shared/RoduxActions.d.ts @@ -0,0 +1,26 @@ +import { RoduxActionFactory } from './RoduxActionFactory'; + +interface RoduxActions { + Init(): void; + CreateReducer( + initialState: unknown, + handlers: Record unknown> + ): ( + state: unknown | undefined, + action: { type: string; [key: string]: unknown } + ) => unknown; + Validate(action: Record): boolean; + Get(actionName: string): RoduxActionFactory | undefined; + Add( + actionName: string, + typeTable: Record boolean> + ): RoduxActionFactory; +} + +interface RoduxActionsConstructor { + readonly ClassName: 'RoduxActions'; + readonly ServiceName: 'RoduxActions'; + new (initFunction: (this: RoduxActions) => void): RoduxActions; +} + +export const RoduxActions: RoduxActionsConstructor; diff --git a/src/rodux-undo/index.d.ts b/src/rodux-undo/index.d.ts new file mode 100644 index 00000000000..d4c4deea860 --- /dev/null +++ b/src/rodux-undo/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/UndoableReducer'; diff --git a/src/rodux-undo/src/Shared/UndoableReducer.d.ts b/src/rodux-undo/src/Shared/UndoableReducer.d.ts new file mode 100644 index 00000000000..b801ddee615 --- /dev/null +++ b/src/rodux-undo/src/Shared/UndoableReducer.d.ts @@ -0,0 +1,3 @@ +export const UndoableReducer: ( + reducer: unknown +) => (state: unknown, action: unknown) => unknown; diff --git a/src/rodux/index.d.ts b/src/rodux/index.d.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rodux/index.d.ts-actions b/src/rodux/index.d.ts-actions new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rodux/index.d.ts-undo b/src/rodux/index.d.ts-undo new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rogue-humanoid/index.d.ts b/src/rogue-humanoid/index.d.ts new file mode 100644 index 00000000000..21e6305c22d --- /dev/null +++ b/src/rogue-humanoid/index.d.ts @@ -0,0 +1,6 @@ +export * from './src/Client/RogueHumanoidClient'; +export * from './src/Client/RogueHumanoidServiceClient'; +export * from './src/Server/RogueHumanoid'; +export * from './src/Server/RogueHumanoidService'; +export * from './src/Shared/RogueHumanoidBase'; +export * from './src/Shared/RogueHumanoidProperties'; diff --git a/src/rogue-humanoid/src/Client/RogueHumanoidClient.d.ts b/src/rogue-humanoid/src/Client/RogueHumanoidClient.d.ts new file mode 100644 index 00000000000..4e6190302e6 --- /dev/null +++ b/src/rogue-humanoid/src/Client/RogueHumanoidClient.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RogueHumanoidBase } from '../Shared/RogueHumanoidBase'; +import { Binder } from '@quenty/binder'; + +interface RogueHumanoidClient extends RogueHumanoidBase {} + +interface RogueHumanoidClientConstructor { + readonly ClassName: 'RogueHumanoidClient'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RogueHumanoidClient; +} + +export const RogueHumanoidClient: Binder; diff --git a/src/rogue-humanoid/src/Client/RogueHumanoidServiceClient.ts b/src/rogue-humanoid/src/Client/RogueHumanoidServiceClient.ts new file mode 100644 index 00000000000..4a74380438e --- /dev/null +++ b/src/rogue-humanoid/src/Client/RogueHumanoidServiceClient.ts @@ -0,0 +1,5 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface RogueHumanoidServiceClient { + Init(serviceBag: ServiceBag): void; +} diff --git a/src/rogue-humanoid/src/Server/RogueHumanoid.d.ts b/src/rogue-humanoid/src/Server/RogueHumanoid.d.ts new file mode 100644 index 00000000000..98fa8a3f4a6 --- /dev/null +++ b/src/rogue-humanoid/src/Server/RogueHumanoid.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RogueHumanoidBase } from '../Shared/RogueHumanoidBase'; +import { PlayerHumanoidBinder } from '@quenty/playerhumanoidbinder'; + +interface RogueHumanoid extends RogueHumanoidBase {} + +interface RogueHumanoidConstructor { + readonly ClassName: 'RogueHumanoid'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RogueHumanoid; +} + +export const RogueHumanoid: PlayerHumanoidBinder; diff --git a/src/rogue-humanoid/src/Server/RogueHumanoidService.d.ts b/src/rogue-humanoid/src/Server/RogueHumanoidService.d.ts new file mode 100644 index 00000000000..0a9ca24a2f9 --- /dev/null +++ b/src/rogue-humanoid/src/Server/RogueHumanoidService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface RogueHumanoidService { + readonly ServiceName: 'RogueHumanoidService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/rogue-humanoid/src/Shared/RogueHumanoidBase.d.ts b/src/rogue-humanoid/src/Shared/RogueHumanoidBase.d.ts new file mode 100644 index 00000000000..eda02996e78 --- /dev/null +++ b/src/rogue-humanoid/src/Shared/RogueHumanoidBase.d.ts @@ -0,0 +1,11 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; + +interface RogueHumanoidBase extends BaseObject {} + +interface RogueHumanoidBaseConstructor { + readonly ClassName: 'RogueHumanoidBase'; + new (humanoid: Humanoid, serviceBag: ServiceBag): RogueHumanoidBase; +} + +export const RogueHumanoidBase: RogueHumanoidBaseConstructor; diff --git a/src/rogue-humanoid/src/Shared/RogueHumanoidProperties.d.ts b/src/rogue-humanoid/src/Shared/RogueHumanoidProperties.d.ts new file mode 100644 index 00000000000..2a3ac2c2dde --- /dev/null +++ b/src/rogue-humanoid/src/Shared/RogueHumanoidProperties.d.ts @@ -0,0 +1,14 @@ +import { RoguePropertyTableDefinition } from '@quenty/rogue-properties'; + +export const RogueHumanoidProperties: RoguePropertyTableDefinition<{ + WalkSpeed: number; + JumpHeight: number; + JumpPower: number; + CharacterUseJumpPower: number; + + Scale: 1; + ScaleMax: 20; + ScaleMin: 0.2; + + MaxHealth: 100; +}>; diff --git a/src/rogue-properties/index.d.ts b/src/rogue-properties/index.d.ts new file mode 100644 index 00000000000..33cdf3b8b2a --- /dev/null +++ b/src/rogue-properties/index.d.ts @@ -0,0 +1,18 @@ +export * from './src/Shared/Array/RoguePropertyArrayConstants'; +export * from './src/Shared/Array/RoguePropertyArrayUtils'; +export * from './src/Shared/Cache/RoguePropertyCache'; +export * from './src/Shared/Cache/RoguePropertyCacheService'; +export * from './src/Shared/Definition/RoguePropertyDefinition'; +export * from './src/Shared/Definition/RoguePropertyDefinitionArrayHelper'; +export * from './src/Shared/Definition/RoguePropertyTableDefinition'; +export * from './src/Shared/Implementation/RogueProperty'; +export * from './src/Shared/Implementation/RoguePropertyArrayHelper'; +export * from './src/Shared/Implementation/RoguePropertyTable'; +export * from './src/Shared/Implementation/RoguePropertyUtils'; +export * from './src/Shared/Modifiers/Implementations/RogueAdditive'; +export * from './src/Shared/Modifiers/Implementations/RogueModifierBase'; +export * from './src/Shared/Modifiers/Implementations/RogueMultiplier'; +export * from './src/Shared/Modifiers/Implementations/RogueSetter'; +export * from './src/Shared/Modifiers/RogueModifierInterface'; +export * from './src/Shared/Modifiers/RoguePropertyModifierData'; +export * from './src/Shared/RoguePropertyService'; diff --git a/src/rogue-properties/src/Shared/Array/RoguePropertyArrayConstants.d.ts b/src/rogue-properties/src/Shared/Array/RoguePropertyArrayConstants.d.ts new file mode 100644 index 00000000000..f4bc87eaafb --- /dev/null +++ b/src/rogue-properties/src/Shared/Array/RoguePropertyArrayConstants.d.ts @@ -0,0 +1,3 @@ +export const RoguePropertyArrayConstants: Readonly<{ + ARRAY_ENTRY_PERFIX: 'ArrayEntry_'; +}>; diff --git a/src/rogue-properties/src/Shared/Array/RoguePropertyArrayUtils.d.ts b/src/rogue-properties/src/Shared/Array/RoguePropertyArrayUtils.d.ts new file mode 100644 index 00000000000..6c8f3f4dd83 --- /dev/null +++ b/src/rogue-properties/src/Shared/Array/RoguePropertyArrayUtils.d.ts @@ -0,0 +1,71 @@ +import { ValueTypeToDefaultValueType } from '@quenty/defaultvalueutils'; +import { RoguePropertyDefinition } from '../Definition/RoguePropertyDefinition'; +import { + RoguePropertyTableDefinition, + ToDefinitionMap, +} from '../Definition/RoguePropertyTableDefinition'; + +type prop = { + value: T; +}; + +type recurse = { + [K in keyof T]: T[K] extends Record + ? recurse + : prop; +}; + +type x = recurse<{ a: { b: { c: number } } }>; +type y = recurse<[number, string, number]>; + +export namespace RoguePropertyArrayUtils { + function getNameFromIndex(index: number): string; + function getIndexFromName(name: string): number | undefined; + function createRequiredPropertyDefinitionFromArray( + arrayData: T[], + parentPropertyTableDefinition: RoguePropertyTableDefinition + ): LuaTuple< + | [roguePropertyDefinition: undefined, errorMessage: string] + | [ + roguePropertyDefinition: T extends (infer U)[] + ? RoguePropertyTableDefinition + : RoguePropertyDefinition, + errorMessage: undefined + ] + >; + function createRequiredTableDefinition( + arrayData: T[] + ): + | [ + roguePropertyTableDefinition: RoguePropertyTableDefinition< + T extends (infer V)[] ? V : never + >, + errorMessage: undefined + ] + | [roguePropertyTableDefinition: undefined, errorMessage: string]; + function createRequiredPropertyDefinitionFromType< + T extends string | keyof ValueTypeToDefaultValueType + >( + expectedType: T, + parentPropertyTableDefinition: RoguePropertyTableDefinition + ): LuaTuple< + | [roguePropertyDefinition: undefined, errorMessage: string] + | [ + roguePropertyDefinition: RoguePropertyDefinition< + T extends keyof ValueTypeToDefaultValueType + ? ValueTypeToDefaultValueType[T] + : unknown + >, + errorMessage: undefined + ] + >; + function createDefinitionsFromContainer( + container: Instance, + parentPropertyTableDefinition: RoguePropertyTableDefinition + ): ToDefinitionMap; + function getDefaultValueMapFromContainer(container: Instance): unknown; + function createDefinitionsFromArrayData( + arrayData: T, + propertyTableDefinition: RoguePropertyTableDefinition + ): ToDefinitionMap; +} diff --git a/src/rogue-properties/src/Shared/Cache/RoguePropertyCache.d.ts b/src/rogue-properties/src/Shared/Cache/RoguePropertyCache.d.ts new file mode 100644 index 00000000000..7aa516a04f3 --- /dev/null +++ b/src/rogue-properties/src/Shared/Cache/RoguePropertyCache.d.ts @@ -0,0 +1,13 @@ +import { RoguePropertyTable } from '../Implementation/RoguePropertyTable'; + +interface RoguePropertyCache { + Store(adornee: Instance, roguePropertyTable: RoguePropertyTable): void; + Find(adornee: Instance): RoguePropertyTable | undefined; +} + +interface RoguePropertyCacheConstructor { + readonly ClassName: 'RoguePropertyCache'; + new (): RoguePropertyCache; +} + +export const RoguePropertyCache: RoguePropertyCacheConstructor; diff --git a/src/rogue-properties/src/Shared/Cache/RoguePropertyCacheService.d.ts b/src/rogue-properties/src/Shared/Cache/RoguePropertyCacheService.d.ts new file mode 100644 index 00000000000..3fb1ff92fcd --- /dev/null +++ b/src/rogue-properties/src/Shared/Cache/RoguePropertyCacheService.d.ts @@ -0,0 +1,11 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyDefinition } from '../Definition/RoguePropertyDefinition'; +import { RoguePropertyCache } from './RoguePropertyCache'; + +export interface RoguePropertyCacheService { + readonly ServiceName: 'RoguePropertyCacheService'; + Init(serviceBag: ServiceBag): void; + GetCache( + roguePropertyDefinition: RoguePropertyDefinition + ): RoguePropertyCache; +} diff --git a/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinition.d.ts b/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinition.d.ts new file mode 100644 index 00000000000..65cb99dbec0 --- /dev/null +++ b/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinition.d.ts @@ -0,0 +1,41 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyTableDefinition } from './RoguePropertyTableDefinition'; +import { EncodedRoguePropertyValue } from '../Implementation/RoguePropertyUtils'; +import { RogueProperty } from '../Implementation/RogueProperty'; + +interface RoguePropertyDefinition { + SetDefaultValue(value: T): void; + Get(serviceBag: ServiceBag, adornee: Instance): RogueProperty; + GetOrCreateInstance(parent: Instance): ValueBase; + SetParentPropertyTableDefinition( + parentPropertyTableDefinition: RoguePropertyTableDefinition + ): void; + GetParentPropertyDefinition(): + | RoguePropertyTableDefinition + | undefined; + CanAssign( + value: unknown + ): LuaTuple< + | [canAssign: true, errorMessage: undefined] + | [canAssign: false, errorMessage: string] + >; + SetName(name: string): void; + GetName(): string; + GetFullName(): string; + GetDefaultValue(): T | undefined; + GetValueType(): keyof CheckableTypes; + GetStorageInstanceType(): string; + GetEncodedDefaultValue(): EncodedRoguePropertyValue | undefined; +} + +interface RoguePropertyDefinitionConstructor { + readonly ClassName: 'RoguePropertyDefinition'; + new (): RoguePropertyDefinition; + new (): RoguePropertyDefinition; + + isRoguePropertyDefinition( + value: unknown + ): value is RoguePropertyDefinition; +} + +export const RoguePropertyDefinition: RoguePropertyDefinitionConstructor; diff --git a/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinitionArrayHelper.d.ts b/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinitionArrayHelper.d.ts new file mode 100644 index 00000000000..0ec711d0397 --- /dev/null +++ b/src/rogue-properties/src/Shared/Definition/RoguePropertyDefinitionArrayHelper.d.ts @@ -0,0 +1,8 @@ +interface RoguePropertyDefinitionArrayHelper {} + +interface RoguePropertyDefinitionArrayHelperConstructor { + readonly ClassName: 'RoguePropertyDefinitionArrayHelper'; + new (): RoguePropertyDefinitionArrayHelper; +} + +export const RoguePropertyDefinitionArrayHelper: RoguePropertyDefinitionArrayHelperConstructor; diff --git a/src/rogue-properties/src/Shared/Definition/RoguePropertyTableDefinition.d.ts b/src/rogue-properties/src/Shared/Definition/RoguePropertyTableDefinition.d.ts new file mode 100644 index 00000000000..e497463e0e9 --- /dev/null +++ b/src/rogue-properties/src/Shared/Definition/RoguePropertyTableDefinition.d.ts @@ -0,0 +1,50 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyDefinition } from './RoguePropertyDefinition'; +import { RoguePropertyDefinitionArrayHelper } from './RoguePropertyDefinitionArrayHelper'; +import { RoguePropertyTable } from '../Implementation/RoguePropertyTable'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +export type ToDefinitionMap = { + [K in keyof T]: T[K] extends Record + ? RoguePropertyTableDefinition + : RoguePropertyDefinition; +}; + +type RoguePropertyTableDefinition< + T extends Record | (T | unknown)[] | unknown +> = ToDefinitionMap & { + SetDefaultValue(value: T): void; + CanAssign( + mainValue: T + ): LuaTuple< + | [canAssign: true, errorMessage: undefined] + | [canAssign: false, errorMessage: string] + >; + GetDefinitionArrayHelper(): RoguePropertyDefinitionArrayHelper; + GetDefinitionMap(): T extends unknown[] ? {} : ToDefinitionMap; + GetDefinition( + propertyName: K + ): RoguePropertyDefinition; + Get(serviceBag: ServiceBag, adornee: Instance): RoguePropertyTable; + ObserveContainerBrio( + adornee: Instance, + canInitialize: boolean + ): Observable>; + GetContainer(adornee: Instance, canInitialize: boolean): Folder | undefined; + GetOrCreateInstance(parent: Instance): Folder; +}; + +interface RoguePropertyTableDefinitionConstructor { + readonly ClassName: 'RoguePropertyTableDefinition'; + new ( + tableName?: string, + defaultValueTable?: T + ): RoguePropertyTableDefinition; + + isRoguePropertyTableDefinition: ( + value: unknown + ) => value is RoguePropertyTableDefinition; +} + +export const RoguePropertyTableDefinition: RoguePropertyTableDefinitionConstructor; diff --git a/src/rogue-properties/src/Shared/Implementation/RogueProperty.d.ts b/src/rogue-properties/src/Shared/Implementation/RogueProperty.d.ts new file mode 100644 index 00000000000..23f36aa6b03 --- /dev/null +++ b/src/rogue-properties/src/Shared/Implementation/RogueProperty.d.ts @@ -0,0 +1,38 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyDefinition } from '../Definition/RoguePropertyDefinition'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface RogueProperty { + Value: T; + readonly Changed: Signal; + + SetCanInitialize(canInitialize: boolean): void; + GetAdornee(): Instance; + CanInitialize(): boolean; + GetBaseValueObject(): ValueBase; + SetBaseValue(value: T): void; + SetValue(value: T): void; + GetBaseValue(): T; + GetValue(): T; + GetDefinition(): RoguePropertyDefinition; + GetRogueModifiers(): unknown; // not sure what this should be + Observe(): Observable; + ObserveBrio(predicate?: (value: T) => boolean): Observable; + CreateMultiplier(amount: number, source?: Instance): ValueBase | undefined; + CreateAdditive(amount: number, source?: Instance): ValueBase | undefined; + GetNamedAdditive(name: string, source?: Instance): ValueBase | undefined; + CreateSetter(value: T, source?: Instance): ValueBase | undefined; + GetChangedEvent(): Signal; +} + +interface RoguePropertyConstructor { + readonly ClassName: 'RogueProperty'; + new ( + adornee: Instance, + serviceBag: ServiceBag, + definition: RoguePropertyDefinition + ): RogueProperty; +} + +export const RogueProperty: RoguePropertyConstructor; diff --git a/src/rogue-properties/src/Shared/Implementation/RoguePropertyArrayHelper.d.ts b/src/rogue-properties/src/Shared/Implementation/RoguePropertyArrayHelper.d.ts new file mode 100644 index 00000000000..5c8c694cb85 --- /dev/null +++ b/src/rogue-properties/src/Shared/Implementation/RoguePropertyArrayHelper.d.ts @@ -0,0 +1,26 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyDefinitionArrayHelper } from '../Definition/RoguePropertyDefinitionArrayHelper'; +import { RoguePropertyTable, ToRogueProperties } from './RoguePropertyTable'; +import { Observable } from '@quenty/rx'; + +interface RoguePropertyArrayHelper { + SetCanInitialize(canInitialize: boolean): void; + GetArrayRogueProperty(index: K): ToRogueProperties[K]; + GetArrayRogueProperties(): ToRogueProperties; + SetArrayBaseData(arrayData: T): void; + SetArrayData(arrayData: T): void; + GetArrayBaseValues(): T; + GetArrayValues(): T; + ObserveArrayValues(): Observable; +} + +interface RoguePropertyArrayHelperConstructor { + readonly ClassName: 'RoguePropertyArrayHelper'; + new ( + serviceBag: ServiceBag, + arrayDefinitionHelper: RoguePropertyDefinitionArrayHelper, + roguePropertyTable: RoguePropertyTable + ): RoguePropertyArrayHelper; +} + +export const RoguePropertyArrayHelper: RoguePropertyArrayHelperConstructor; diff --git a/src/rogue-properties/src/Shared/Implementation/RoguePropertyTable.d.ts b/src/rogue-properties/src/Shared/Implementation/RoguePropertyTable.d.ts new file mode 100644 index 00000000000..dd55f9ae88a --- /dev/null +++ b/src/rogue-properties/src/Shared/Implementation/RoguePropertyTable.d.ts @@ -0,0 +1,43 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RoguePropertyTableDefinition } from '../Definition/RoguePropertyTableDefinition'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { RogueProperty } from './RogueProperty'; +import { Signal } from '@quenty/signal'; + +export type ToRogueProperties = { + readonly [K in keyof T]: T[K] extends Record + ? RoguePropertyTable + : RogueProperty; +}; + +type RoguePropertyTable = Omit< + Omit, 'Changed'>, + 'Observe' +> & + ToRogueProperties & { + Value: T; + readonly Changed: Signal>; + + SetCanInitialize(canInitialize: boolean): void; + ObserveContainerBrio(): Observable>; + GetContainer(): Folder | undefined; + SetBaseValues(newBaseValue: T): void; + SetValue(newValue: T): void; + GetRogueProperties(): ToRogueProperties; + GetValue(): T; + GetBaseValue(): T; + Observe(): Observable>; + GetRogueProperty(name: K): RogueProperty; + }; + +interface RoguePropertyTableConstructor { + readonly ClassName: 'RoguePropertyTable'; + new ( + adornee: Instance, + serviceBag: ServiceBag, + roguePropertyTableDefinition: RoguePropertyTableDefinition + ): RoguePropertyTable; +} + +export const RoguePropertyTable: RoguePropertyTableConstructor; diff --git a/src/rogue-properties/src/Shared/Implementation/RoguePropertyUtils.d.ts b/src/rogue-properties/src/Shared/Implementation/RoguePropertyUtils.d.ts new file mode 100644 index 00000000000..adecb292416 --- /dev/null +++ b/src/rogue-properties/src/Shared/Implementation/RoguePropertyUtils.d.ts @@ -0,0 +1,17 @@ +import { RoguePropertyDefinition } from '../Definition/RoguePropertyDefinition'; + +export type EncodedRoguePropertyValue = { + readonly __brand: unique symbol; + readonly __value: T; +}; + +export namespace RoguePropertyUtils { + function encodeProperty( + definition: RoguePropertyDefinition, + value: T + ): EncodedRoguePropertyValue; + function decodeProperty( + definition: RoguePropertyDefinition, + value: EncodedRoguePropertyValue + ): T; +} diff --git a/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueAdditive.d.ts b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueAdditive.d.ts new file mode 100644 index 00000000000..0ab6061ba82 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueAdditive.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RogueModifierBase } from './RogueModifierBase'; +import { Binder } from '@quenty/binder'; + +export interface RogueAdditive extends RogueModifierBase {} + +export interface RogueAdditiveConstructor { + readonly ClassName: 'RogueAdditive'; + new (obj: ValueBase, serviceBag: ServiceBag): RogueAdditive; +} + +export const RogueAdditive: Binder; diff --git a/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueModifierBase.d.ts b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueModifierBase.d.ts new file mode 100644 index 00000000000..01355a1d959 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueModifierBase.d.ts @@ -0,0 +1,19 @@ +import { AttributeValue } from '@quenty/attributeutils'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +interface RogueModifierBase { + Order: AttributeValue; + Source: ObjectValue; + + GetModifiedVersion(value: number): number; + ObserveModifiedVersion(value: number): Observable; + GetInvertedVersion(value: number): number; +} + +interface RogueModifierBaseConstructor { + readonly ClassName: 'RogueModifierBase'; + new (obj: ValueBase, serviceBag: ServiceBag): RogueModifierBase; +} + +export const RogueModifierBase: RogueModifierBaseConstructor; diff --git a/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueMultiplier.d.ts b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueMultiplier.d.ts new file mode 100644 index 00000000000..3b809310732 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueMultiplier.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RogueModifierBase } from './RogueModifierBase'; +import { Binder } from '@quenty/binder'; + +export interface RogueMultiplier extends RogueModifierBase {} + +export interface RogueMultiplierConstructor { + readonly ClassName: 'RogueMultiplier'; + new (obj: ValueBase, serviceBag: ServiceBag): RogueMultiplier; +} + +export const RogueMultiplier: Binder; diff --git a/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueSetter.d.ts b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueSetter.d.ts new file mode 100644 index 00000000000..5646ac4ca29 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/Implementations/RogueSetter.d.ts @@ -0,0 +1,12 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { RogueModifierBase } from './RogueModifierBase'; +import { Binder } from '@quenty/binder'; + +export interface RogueSetter extends RogueModifierBase {} + +export interface RogueSetterConstructor { + readonly ClassName: 'RogueSetter'; + new (obj: ValueBase, serviceBag: ServiceBag): RogueSetter; +} + +export const RogueSetter: Binder; diff --git a/src/rogue-properties/src/Shared/Modifiers/RogueModifierInterface.d.ts b/src/rogue-properties/src/Shared/Modifiers/RogueModifierInterface.d.ts new file mode 100644 index 00000000000..3d64fb5d6d7 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/RogueModifierInterface.d.ts @@ -0,0 +1,14 @@ +import { + TieDefinition, + TieDefinitionMethod, + TieDefinitionProperty, +} from '@quenty/tie'; + +export const RogueModifierInterface: TieDefinition<{ + Order: TieDefinitionProperty; + Source: TieDefinitionProperty; + + GetModifiedVersion: TieDefinitionMethod; + ObserveModifiedVersion: TieDefinitionMethod; + GetInvertedVersion: TieDefinitionMethod; +}>; diff --git a/src/rogue-properties/src/Shared/Modifiers/RoguePropertyModifierData.d.ts b/src/rogue-properties/src/Shared/Modifiers/RoguePropertyModifierData.d.ts new file mode 100644 index 00000000000..e0355459267 --- /dev/null +++ b/src/rogue-properties/src/Shared/Modifiers/RoguePropertyModifierData.d.ts @@ -0,0 +1,6 @@ +import { AdorneeData, AdorneeDataEntry } from '@quenty/adorneedata'; + +export const RoguePropertyModifierData: AdorneeData<{ + Order: number; + RoguePropertySourceLink: AdorneeDataEntry; +}>; diff --git a/src/rogue-properties/src/Shared/RoguePropertyService.d.ts b/src/rogue-properties/src/Shared/RoguePropertyService.d.ts new file mode 100644 index 00000000000..8f597813959 --- /dev/null +++ b/src/rogue-properties/src/Shared/RoguePropertyService.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface RoguePropertyService { + readonly ServiceName: 'RoguePropertyService'; + Init(serviceBag: ServiceBag): void; + CanInitializeProperties(): boolean; + Destroy(): void; +} diff --git a/src/rogue/index.d.ts b/src/rogue/index.d.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rogue/index.d.ts-humanoid b/src/rogue/index.d.ts-humanoid new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rogue/index.d.ts-properties b/src/rogue/index.d.ts-properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/rotatinglabel/index.d.ts b/src/rotatinglabel/index.d.ts new file mode 100644 index 00000000000..20fd6b5bd6a --- /dev/null +++ b/src/rotatinglabel/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/RotatingCharacter'; +export * from './src/Client/RotatingCharacterBuilder'; +export * from './src/Client/RotatingLabel'; +export * from './src/Client/RotatingLabelBuilder'; diff --git a/src/rotatinglabel/src/Client/RotatingCharacter.d.ts b/src/rotatinglabel/src/Client/RotatingCharacter.d.ts new file mode 100644 index 00000000000..787ecab244f --- /dev/null +++ b/src/rotatinglabel/src/Client/RotatingCharacter.d.ts @@ -0,0 +1,29 @@ +interface RotatingCharacter { + Gui: GuiObject; + TargetCharacter: string; + Character: string; + // cant type TransparencyList because of the metatable + TransparencyList: unknown; + readonly IsDoneAnimating: boolean; + readonly NextCharacter: string; + readonly Position: number; + Transparency: number; + readonly TransparencyMap: Map< + GuiObject & { + TextTransparency: number; + TextStrokeTransparency: number; + }, + number + >; + UpdatePositionRender(): void; + UpdateRender(): void; + CharToInt(char: string): number; + Destroy(): void; +} + +interface RotatingCharacterConstructor { + readonly ClassName: 'RotatingCharacter'; + new (gui: GuiObject): RotatingCharacter; +} + +export const RotatingCharacter: RotatingCharacterConstructor; diff --git a/src/rotatinglabel/src/Client/RotatingCharacterBuilder.d.ts b/src/rotatinglabel/src/Client/RotatingCharacterBuilder.d.ts new file mode 100644 index 00000000000..7cccbaf57d7 --- /dev/null +++ b/src/rotatinglabel/src/Client/RotatingCharacterBuilder.d.ts @@ -0,0 +1,16 @@ +import { RotatingCharacter } from './RotatingCharacter'; + +interface RotatingCharacterBuilder { + WithTemplate(textLabelTemplate: TextLabel): this; + Generate(parent: Instance): this; + WithGui(gui: GuiObject): this; + WithCharacter(char: string): this; + Create(): RotatingCharacter; +} + +interface RotatingCharacterBuilderConstructor { + readonly ClassName: 'RotatingCharacterBuilder'; + new (): RotatingCharacterBuilder; +} + +export const RotatingCharacterBuilder: RotatingCharacterBuilderConstructor; diff --git a/src/rotatinglabel/src/Client/RotatingLabel.d.ts b/src/rotatinglabel/src/Client/RotatingLabel.d.ts new file mode 100644 index 00000000000..b770ee749de --- /dev/null +++ b/src/rotatinglabel/src/Client/RotatingLabel.d.ts @@ -0,0 +1,20 @@ +interface RotatingLabel { + SetGui(gui: GuiObject): void; + SetTemplate(template: TextLabel): void; + Text: string; + readonly TotalWidth: number; + Width: number; + Transparency: number; + Damper: number; + Speed: number; + TextXAlignment: string; + UpdateRender(): void; + Destroy(): void; +} + +interface RotatingLabelConstructor { + readonly ClassName: 'RotatingLabel'; + new (): RotatingLabel; +} + +export const RotatingLabel: RotatingLabelConstructor; diff --git a/src/rotatinglabel/src/Client/RotatingLabelBuilder.d.ts b/src/rotatinglabel/src/Client/RotatingLabelBuilder.d.ts new file mode 100644 index 00000000000..1d93bf8c58a --- /dev/null +++ b/src/rotatinglabel/src/Client/RotatingLabelBuilder.d.ts @@ -0,0 +1,14 @@ +import { RotatingLabel } from './RotatingLabel'; + +interface RotatingLabelBuilder { + WithTemplate(template: TextLabel): this; + WithGui(gui: GuiObject): this; + Create(): RotatingLabel; +} + +interface RotatingLabelBuilderConstructor { + readonly ClassName: 'RotatingLabelBuilder'; + new (template?: TextLabel): RotatingLabelBuilder; +} + +export const RotatingLabelBuilder: RotatingLabelBuilderConstructor; diff --git a/src/roundedbackingbuilder/index.d.ts b/src/roundedbackingbuilder/index.d.ts new file mode 100644 index 00000000000..2ad5c010095 --- /dev/null +++ b/src/roundedbackingbuilder/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/RoundedBackingBuilder'; diff --git a/src/roundedbackingbuilder/src/Client/RoundedBackingBuilder.d.ts b/src/roundedbackingbuilder/src/Client/RoundedBackingBuilder.d.ts new file mode 100644 index 00000000000..4f59797a49c --- /dev/null +++ b/src/roundedbackingbuilder/src/Client/RoundedBackingBuilder.d.ts @@ -0,0 +1,17 @@ +interface RoundedBackingBuilder { + Create(gui: GuiObject): ImageLabel; + CreateBacking(gui: GuiObject): ImageLabel; + CreateTopBacking(gui: GuiObject): ImageLabel; + CreateLeftBacking(gui: GuiObject): ImageLabel; + CreateRightBacking(gui: GuiObject): ImageLabel; + CreateBottomBacking(gui: GuiObject): ImageLabel; + CreateTopShadow(backing: GuiObject): ImageLabel; + CreateShadow(backing: GuiObject): ImageLabel; +} + +interface RoundedBackingBuilderConstructor { + readonly ClassName: 'RoundedBackingBuilder'; + new (options?: { sibling: boolean }): RoundedBackingBuilder; +} + +export const RoundedBackingBuilder: RoundedBackingBuilderConstructor; diff --git a/src/rx/index.d.ts b/src/rx/index.d.ts new file mode 100644 index 00000000000..ad332953b74 --- /dev/null +++ b/src/rx/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Shared/Observable'; +export * from './src/Shared/Rx'; +export * from './src/Shared/Subscription'; +export * from './src/Shared/ObservableSubscriptionTable'; diff --git a/src/rx/src/Shared/Observable.d.ts b/src/rx/src/Shared/Observable.d.ts new file mode 100644 index 00000000000..438794cbab8 --- /dev/null +++ b/src/rx/src/Shared/Observable.d.ts @@ -0,0 +1,111 @@ +import { MaidTask } from '@quenty/maid'; +import { Subscription } from './Subscription'; + +type Observable = { + // we type out the Pipe method using varargs instead of an array of operators. + // this is because typescript cannot infer types from operator to operator (this is a typescript limitation) + // however, typescript can infer types using the overloads below. this is also how rxjs does it. + // our fork of roblox-ts will convert the outputted luau to use an array of operators. + Pipe(): Observable; + Pipe(op1: Operator): Observable; + Pipe(op1: Operator, op2: Operator): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator, + op6: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator, + op6: Operator, + op7: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator, + op6: Operator, + op7: Operator, + op8: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator, + op6: Operator, + op7: Operator, + op8: Operator, + op9: Operator + ): Observable; + Pipe( + op1: Operator, + op2: Operator, + op3: Operator, + op4: Operator, + op5: Operator, + op6: Operator, + op7: Operator, + op8: Operator, + op9: Operator, + op10: Operator + ): Observable; + Pipe(...operators: Operator[]): Observable; + // tuple wrap to prevent distributive conditional types + Subscribe( + fireCallback?: [T] extends [LuaTuple] + ? (...args: V) => void + : (value: T) => void, + failCallback?: () => void, + completeCallback?: () => void + ): Subscription; + // overload for unresolved generic + Subscribe( + fireCallback?: (value: T) => void, + failCallback?: () => void, + completeCallback?: () => void + ): Subscription; +}; + +export type Operator = (source: Observable) => Observable; + +interface ObservableConstructor { + readonly ClassName: 'Observable'; + new ( + onSubscribe: (subscription: Subscription) => MaidTask | undefined | void + ): Observable; + new ( + onSubscribe: (subscription: Subscription) => MaidTask | undefined | void + ): Observable; + + isObservable: (value: unknown) => value is Observable; +} + +export const Observable: ObservableConstructor; diff --git a/src/rx/src/Shared/ObservableSubscriptionTable.d.ts b/src/rx/src/Shared/ObservableSubscriptionTable.d.ts new file mode 100644 index 00000000000..deae5dc5460 --- /dev/null +++ b/src/rx/src/Shared/ObservableSubscriptionTable.d.ts @@ -0,0 +1,22 @@ +import { Observable } from './Observable'; +import { ToTuple } from './Rx'; +import { Subscription } from './Subscription'; + +type ObservableSubscriptionTable = { + Fire(key: unknown, ...values: ToTuple): void; + HasSubscriptions(key: unknown): boolean; + Compelte(key: unknown): void; + Fail(key: unknown): void; + Observe( + key: unknown, + callback?: (sub: Subscription) => void + ): Observable; + Destroy(): void; +}; + +interface ObservableSubscriptionTableConstructor { + readonly ClassName: 'ObservableSubscriptionTable'; + new (): ObservableSubscriptionTable; +} + +export const ObservableSubscriptionTable: ObservableSubscriptionTableConstructor; diff --git a/src/rx/src/Shared/Rx.d.ts b/src/rx/src/Shared/Rx.d.ts new file mode 100644 index 00000000000..d46356887b5 --- /dev/null +++ b/src/rx/src/Shared/Rx.d.ts @@ -0,0 +1,155 @@ +import { Observable, Operator } from './Observable'; +import { MaidTask } from '@quenty/maid'; +import { Signal, SignalLike } from '@quenty/signal'; +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; + +type ToTuple = T extends [unknown, ...unknown[]] ? T : [T]; + +export type Predicate = (value: T) => boolean; + +export namespace Rx { + const EMPTY: Observable; + const NEVER: Observable; + + function pipe(transformers: Array>): Operator; + + function of(...args: T): Observable; + function failed(...args: ToTuple): Observable; + function from(item: Promise | T[]): Observable; + function toPromise( + observable: Observable, + cancelToken?: CancelToken + ): Promise; + function merge[]>( + observables: T + ): Observable[] ? U : never>; + function fromSignal( + event: RBXScriptSignal + ): Observable< + T extends (...args: infer U) => void + ? U['length'] extends 1 + ? U[0] + : LuaTuple + : never + >; + function fromSignal(event: Signal): Observable; + function fromSignal(event: { + Connect: (cb: (...args: T) => void) => unknown; + }): Observable>; + function fromSignal(event: SignalLike): Observable; + + function fromPromise(promise: Promise): Observable; + + function tap( + onFire?: (...args: ToTuple) => void, + onError?: (...args: unknown[]) => void, + onComplete?: (...args: unknown[]) => void + ): Operator; + + function start(callback: () => T): Operator; + function share(): Operator; + function shareReplay( + bufferSize?: number, + windowTimeSeconds?: number + ): Operator; + function cache(): Operator; + function startFrom(callback: () => U[]): Operator; + function startWith(values: U[]): Operator; + function scan( + accumulator: (acc: T, ...args: ToTuple) => T, + seed?: T + ): Operator; + function reduce( + reducer: (acc: T, ...args: ToTuple) => T, + seed?: T + ): Operator; + function defaultsTo(value: V): Operator; + function defaultsToNil(source: Observable): Observable; + function endWith(...values: ToTuple): Operator; + + function where( + predicate: (value: T) => value is NonNullable + ): Operator>; + function where( + predicate: (value: T) => value is Exclude> + ): Operator>>; + // we cant do a tuple check here so we fallback to any[] (should be ok since not a lot of observables emit tuples) + function where(predicate: (value: T) => boolean): Operator; + function where(predicate: (...values: any[]) => boolean): Operator; + + function distinct(): Operator; + function mapTo(...args: ToTuple): Operator; + function map( + project: (...args: ToTuple) => U + ): Operator; + function mergeAll(): Operator, T>; + function switchAll(): Operator, T>; + function flatMap( + project: (...args: ToTuple) => Observable + ): Operator; + function switchMap( + project: (...args: ToTuple) => Observable + ): Operator; + function takeUntil(notifier: Observable): Operator; + function packed(...args: ToTuple): Observable; + function unpacked(observable: Observable): Observable; + function finalize(finalizerCallback: () => void): Operator; + function combineLatestAll(): ( + source: Observable> + ) => Observable; + function combineAll(source: Observable>): Observable; + function catchError( + callback: (error: E) => Observable + ): Operator; + function combineLatest< + T extends Record | unknown>, + >( + observables: T + ): Observable<{ + [K in keyof T]: T[K] extends Observable ? V : T[K]; + }>; + const combineLatestDefer: typeof combineLatest; + function defer(observableFactory: () => Observable): Observable; + function delay(seconds: number): Operator; + function delayed(seconds: number): Observable; + function timer( + initialDelaySeconds: number, + seconds: number + ): Observable; + function interval(seconds: number): Observable; + function withLatestFrom( + inputObservables: Observable[] + ): Operator]>; + function throttleTime( + duration: number, + throttleConfig?: { leading?: boolean; trailing?: boolean } + ): Operator; + function onlyAfterDefer(): Operator; + function throttleDefer(): Operator; + function throttle( + durationSelector: (...args: ToTuple) => Observable + ): Operator; + function skipUntil(notifier: Observable): Operator; + function skipWhile( + predicate: (index: number, ...args: ToTuple) => boolean + ): Operator; + function takeWhile( + predicate: (index: number, ...args: ToTuple) => boolean + ): Operator; + function switchScan( + accumulator: (acc: T | undefined, ...args: ToTuple) => Observable, + seed?: T + ): Operator; + function mergeScan( + accumulator: (acc: T | undefined, ...args: ToTuple) => Observable, + seed?: T + ): Operator; + function using( + resourceFactory: () => MaidTask, + observableFactory: (resource: MaidTask) => Observable + ): Observable; + function first(): Operator; + function take(count: number): Operator; + function skip(count: number): Operator; +} diff --git a/src/rx/src/Shared/Subscription.d.ts b/src/rx/src/Shared/Subscription.d.ts new file mode 100644 index 00000000000..89980df8419 --- /dev/null +++ b/src/rx/src/Shared/Subscription.d.ts @@ -0,0 +1,30 @@ +type Subscription = { + Fire(value: T): void; + Fail(): void; + GetFireFailComplete(): LuaTuple< + [ + fireCallback: () => void, + failCallback: () => void, + completeCallback: () => void + ] + >; + GetFailComplete(): LuaTuple< + [failCallback: () => void, completeCallback: () => void] + >; + Complete(): void; + IsPending(): boolean; + Destroy(): void; + Disconnect(): void; +}; + +interface SubscriptionConstructor { + readonly ClassName: 'Subscription'; + new ( + fireCallback: () => void, + failCallback: () => void, + completeCallback: () => void, + observableSource?: string + ): Subscription; +} + +export const Subscription: SubscriptionConstructor; diff --git a/src/rxbinderutils/index.d.ts b/src/rxbinderutils/index.d.ts new file mode 100644 index 00000000000..c9a4455e32a --- /dev/null +++ b/src/rxbinderutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxBinderUtils'; +export * from './src/Shared/RxBinderGroupUtils'; diff --git a/src/rxbinderutils/src/Shared/RxBinderGroupUtils.d.ts b/src/rxbinderutils/src/Shared/RxBinderGroupUtils.d.ts new file mode 100644 index 00000000000..3aacb215f6d --- /dev/null +++ b/src/rxbinderutils/src/Shared/RxBinderGroupUtils.d.ts @@ -0,0 +1,13 @@ +import { Binder } from '@quenty/binder'; +import { BinderGroup } from '@quenty/binder/src/Shared/BinderGroup'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx/src/Shared/Observable'; + +export namespace RxBinderGroupUtils { + function observeBinders( + binderGroup: BinderGroup + ): Observable>; + function observeAllClassesBrio( + binderGroup: BinderGroup + ): Observable>; +} diff --git a/src/rxbinderutils/src/Shared/RxBinderUtils.d.ts b/src/rxbinderutils/src/Shared/RxBinderUtils.d.ts new file mode 100644 index 00000000000..9591fc3c8cf --- /dev/null +++ b/src/rxbinderutils/src/Shared/RxBinderUtils.d.ts @@ -0,0 +1,38 @@ +import { Binder } from '@quenty/binder'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx/src/Shared/Observable'; + +export namespace RxBinderUtils { + function observeLinkedBoundClassBrio( + linkName: string, + parent: Instance, + binder: Binder + ): Observable>; + function observeChildrenBrio( + binder: Binder, + instance: Instance + ): Observable>; + const observeBoundChildClassBrio: typeof observeChildrenBrio; + function observeBoundParentClassBrio( + binder: Binder, + instance: Instance + ): Observable>; + function observeBoundChildClassesBrio( + binders: { [K in keyof T]: Binder }, + instance: Instance + ): Observable>; + function observeBoundClass( + binder: Binder, + instance: Instance + ): Observable; + function observeBoundClassBrio( + binder: Binder, + instance: Instance + ): Observable>; + function observeBoundClassesBrio( + binders: { [K in keyof T]: Binder }, + instance: Instance + ): Observable>; + function observeAllBrio(binder: Binder): Observable>; + function observeAllArrayBrio(binder: Binder): Observable>; +} diff --git a/src/rxsignal/index.d.ts b/src/rxsignal/index.d.ts new file mode 100644 index 00000000000..f75f031d1dc --- /dev/null +++ b/src/rxsignal/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RxSignal'; diff --git a/src/rxsignal/src/Shared/RxSignal.d.ts b/src/rxsignal/src/Shared/RxSignal.d.ts new file mode 100644 index 00000000000..d4614a2b94d --- /dev/null +++ b/src/rxsignal/src/Shared/RxSignal.d.ts @@ -0,0 +1,16 @@ +import { Observable, Subscription } from '@quenty/rx'; + +type ToTuple = T extends unknown[] ? T : [T]; + +interface RxSignal { + Connect(callback: (...args: ToTuple) => void): Subscription; + Wait(): T extends void ? void : T extends unknown[] ? LuaTuple : T; + Once(callback: (...args: ToTuple) => void): Subscription; +} + +interface RxSignalConstructor { + readonly ClassName: 'RxSignal'; + new (observable: Observable | (() => Observable)): RxSignal; +} + +export const RxSignal: RxSignalConstructor; diff --git a/src/safedestroy/index.d.ts b/src/safedestroy/index.d.ts new file mode 100644 index 00000000000..1c9d2710095 --- /dev/null +++ b/src/safedestroy/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/safeDestroy'; diff --git a/src/safedestroy/src/Shared/safeDestroy.d.ts b/src/safedestroy/src/Shared/safeDestroy.d.ts new file mode 100644 index 00000000000..e5c966042bd --- /dev/null +++ b/src/safedestroy/src/Shared/safeDestroy.d.ts @@ -0,0 +1 @@ +export function safeDestroy(instance: Instance): void; diff --git a/src/scoredactionservice/index.d.ts b/src/scoredactionservice/index.d.ts new file mode 100644 index 00000000000..a854859cd04 --- /dev/null +++ b/src/scoredactionservice/index.d.ts @@ -0,0 +1,8 @@ +export * from './src/Client/InputList/InputListScoreHelper'; +export * from './src/Client/Picker/ScoredActionPicker'; +export * from './src/Client/Picker/ScoredActionPickerProvider'; +export * from './src/Client/Picker/TouchButtonScoredActionPicker'; +export * from './src/Client/ScoredAction'; +export * from './src/Client/ScoredActionServiceClient'; +export * from './src/Client/ScoredActionUtils'; +export * from './src/Server/ScoredActionService'; diff --git a/src/scoredactionservice/src/Client/InputList/InputListScoreHelper.d.ts b/src/scoredactionservice/src/Client/InputList/InputListScoreHelper.d.ts new file mode 100644 index 00000000000..d3129e0534b --- /dev/null +++ b/src/scoredactionservice/src/Client/InputList/InputListScoreHelper.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { ScoredActionPickerProvider } from '../Picker/ScoredActionPickerProvider'; +import { ScoredAction } from '../ScoredAction'; +import { InputKeyMapList } from '@quenty/inputkeymaputils'; + +interface InputListScoreHelper extends BaseObject {} + +interface InputListScoreHelperConstructor { + readonly ClassName: 'InputListScoreHelper'; + new ( + serviceBag: ServiceBag, + provider: ScoredActionPickerProvider, + scoredAction: ScoredAction, + inputKeyMapList: InputKeyMapList + ): InputListScoreHelper; +} + +export const InputListScoreHelper: InputListScoreHelperConstructor; diff --git a/src/scoredactionservice/src/Client/Picker/ScoredActionPicker.d.ts b/src/scoredactionservice/src/Client/Picker/ScoredActionPicker.d.ts new file mode 100644 index 00000000000..fe781e3abbd --- /dev/null +++ b/src/scoredactionservice/src/Client/Picker/ScoredActionPicker.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ScoredAction } from '../ScoredAction'; + +interface ScoredActionPicker extends BaseObject { + Update(): void; + AddAction(action: ScoredAction): void; + RemoveAction(action: ScoredAction): void; + HasActions(): boolean; +} + +interface ScoredActionPickerConstructor { + readonly ClassName: 'ScoredActionPicker'; + new (): ScoredActionPicker; +} + +export const ScoredActionPicker: ScoredActionPickerConstructor; diff --git a/src/scoredactionservice/src/Client/Picker/ScoredActionPickerProvider.d.ts b/src/scoredactionservice/src/Client/Picker/ScoredActionPickerProvider.d.ts new file mode 100644 index 00000000000..102b515b07a --- /dev/null +++ b/src/scoredactionservice/src/Client/Picker/ScoredActionPickerProvider.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { InputType } from '@quenty/inputkeymaputils'; +import { ScoredActionPicker } from './ScoredActionPicker'; + +interface ScoredActionPickerProvider extends BaseObject { + FindPicker(inputType: InputType): ScoredActionPicker | undefined; + GetOrCreatePicker(inputType: InputType): ScoredActionPicker; + Update(): void; +} + +interface ScoredActionPickerProviderConstructor { + readonly ClassName: 'ScoredActionPickerProvider'; + new (): ScoredActionPickerProvider; +} + +export const ScoredActionPickerProvider: ScoredActionPickerProviderConstructor; diff --git a/src/scoredactionservice/src/Client/Picker/TouchButtonScoredActionPicker.d.ts b/src/scoredactionservice/src/Client/Picker/TouchButtonScoredActionPicker.d.ts new file mode 100644 index 00000000000..93ec60a5f5d --- /dev/null +++ b/src/scoredactionservice/src/Client/Picker/TouchButtonScoredActionPicker.d.ts @@ -0,0 +1,16 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ScoredAction } from '../ScoredAction'; + +interface TouchButtonScoredActionPicker extends BaseObject { + Update(): void; + AddAction(action: ScoredAction): void; + RemoveAction(action: ScoredAction): void; + HasActions(): boolean; +} + +interface TouchButtonScoredActionPickerConstructor { + readonly ClassName: 'TouchButtonScoredActionPicker'; + new (): TouchButtonScoredActionPicker; +} + +export const TouchButtonScoredActionPicker: TouchButtonScoredActionPickerConstructor; diff --git a/src/scoredactionservice/src/Client/ScoredAction.d.ts b/src/scoredactionservice/src/Client/ScoredAction.d.ts new file mode 100644 index 00000000000..9aa0693c9f6 --- /dev/null +++ b/src/scoredactionservice/src/Client/ScoredAction.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface ScoredAction extends BaseObject { + PreferredChanged: Signal; + Removing: Signal; + IsPreferred(): boolean; + ObservePreferred(): Observable; + SetScore(score: number): void; + GetScore(): number; + PushPreferred(): () => void; +} + +interface ScoredActionConstructor { + readonly ClassName: 'ScoredAction'; + new (): ScoredAction; +} + +export const ScoredAction: ScoredActionConstructor; diff --git a/src/scoredactionservice/src/Client/ScoredActionServiceClient.d.ts b/src/scoredactionservice/src/Client/ScoredActionServiceClient.d.ts new file mode 100644 index 00000000000..0a384514bc1 --- /dev/null +++ b/src/scoredactionservice/src/Client/ScoredActionServiceClient.d.ts @@ -0,0 +1,16 @@ +import { InputKeyMapList } from '@quenty/inputkeymaputils'; +import { ServiceBag } from '@quenty/servicebag'; +import { ScoredAction } from './ScoredAction'; +import { ValueObject } from '@quenty/valueobject'; +import { Operator } from '@quenty/rx'; + +export interface ScoredActionServiceClient { + readonly ServiceName: 'ScoredActionServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetScoredAction(inputKeyMapList: InputKeyMapList): ScoredAction; + ObserveNewFromInputKeyMapList( + scoreValue: ValueObject + ): Operator; + Destroy(): void; +} diff --git a/src/scoredactionservice/src/Client/ScoredActionUtils.d.ts b/src/scoredactionservice/src/Client/ScoredActionUtils.d.ts new file mode 100644 index 00000000000..fbfac7cdd36 --- /dev/null +++ b/src/scoredactionservice/src/Client/ScoredActionUtils.d.ts @@ -0,0 +1,9 @@ +import { Maid } from '@quenty/maid'; +import { ScoredAction } from './ScoredAction'; + +export namespace ScoredActionUtils { + function connectToPreferred( + scoredAction: ScoredAction, + callback: (maid: Maid) => void + ): Maid; +} diff --git a/src/scoredactionservice/src/Server/ScoredActionService.d.ts b/src/scoredactionservice/src/Server/ScoredActionService.d.ts new file mode 100644 index 00000000000..abee49bea9e --- /dev/null +++ b/src/scoredactionservice/src/Server/ScoredActionService.d.ts @@ -0,0 +1,5 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface ScoredActionService { + Init(serviceBag: ServiceBag): void; +} diff --git a/src/screenshothudservice/index.d.ts b/src/screenshothudservice/index.d.ts new file mode 100644 index 00000000000..54fabae64f6 --- /dev/null +++ b/src/screenshothudservice/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/ScreenshotHudModel'; +export * from './src/Client/ScreenshotHudServiceClient'; diff --git a/src/screenshothudservice/src/Client/ScreenshotHudModel.d.ts b/src/screenshothudservice/src/Client/ScreenshotHudModel.d.ts new file mode 100644 index 00000000000..e67fe261f1a --- /dev/null +++ b/src/screenshothudservice/src/Client/ScreenshotHudModel.d.ts @@ -0,0 +1,39 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface ScreenshotHudModel extends BaseObject { + CloseRequested: Signal; + SetCloseButtonVisible(closeButtonVisible: boolean): void; + ObserveCloseButtonVisible(): Observable; + SetCameraButtonVisible(cameraButtonVisible: boolean): void; + ObserveCameraButtonVisible(): Observable; + SetKeepOpen(keepOpen: boolean): void; + GetKeepOpen(): boolean; + SetVisible(visible: boolean): void; + SetCloseButtonPosition(position: UDim2 | undefined): void; + ObserveCloseButtonPosition(): Observable; + SetCameraButtonPosition(position: UDim2 | undefined): void; + ObserveCameraButtonPosition(): Observable; + SetOverlayFont(overlayFont: Enum.Font | undefined): void; + ObserveOverlayFont(): Observable; + SetCameraButtonIcon(icon: string | undefined): void; + ObserveCameraButtonIcon(): Observable; + SetCloseWhenScreenshotTaken(closeWhenScreenshotTaken: boolean): void; + GetCloseWhenScreenshotTaken(): boolean; + ObserveCloseWhenScreenshotTaken(): Observable; + SetExperienceNameOverlayEnabled(experienceNameOverlayEnabled: boolean): void; + ObserveExperienceNameOverlayEnabled(): Observable; + SetUsernameOverlayEnabled(usernameOverlayEnabled: boolean): void; + ObserveUsernameOverlayEnabled(): Observable; + ObserveVisible(): Observable; + InternalNotifyVisible(isVisible: boolean): void; + InternalFireClosedRequested(): void; +} + +interface ScreenshotHudModelConstructor { + readonly ClassName: 'ScreenshotHudModel'; + new (): ScreenshotHudModel; +} + +export const ScreenshotHudModel: ScreenshotHudModelConstructor; diff --git a/src/screenshothudservice/src/Client/ScreenshotHudServiceClient.d.ts b/src/screenshothudservice/src/Client/ScreenshotHudServiceClient.d.ts new file mode 100644 index 00000000000..f13dedf9e07 --- /dev/null +++ b/src/screenshothudservice/src/Client/ScreenshotHudServiceClient.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { ScreenshotHudModel } from './ScreenshotHudModel'; + +export interface ScreenshotHudServiceClient { + readonly ServiceName: 'ScreenshotHudServiceClient'; + Init(serviceBag: ServiceBag): void; + PushModel(screenshotHudModel: ScreenshotHudModel): () => void; + Destroy(): void; +} diff --git a/src/scrollingframe/index.d.ts b/src/scrollingframe/index.d.ts new file mode 100644 index 00000000000..e2082753f30 --- /dev/null +++ b/src/scrollingframe/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/SCROLL_TYPE'; +export * from './src/Client/ScrollModel'; +export * from './src/Client/Scrollbar'; +export * from './src/Client/ScrollingFrame'; diff --git a/src/scrollingframe/src/Client/SCROLL_TYPE.d.ts b/src/scrollingframe/src/Client/SCROLL_TYPE.d.ts new file mode 100644 index 00000000000..245e08b4b5e --- /dev/null +++ b/src/scrollingframe/src/Client/SCROLL_TYPE.d.ts @@ -0,0 +1,12 @@ +export interface ScrollType { + Direction: 'x' | 'y'; +} + +export const SCROLL_TYPE: Readonly<{ + Horizontal: { + Direction: 'x'; + }; + Vertical: { + Direction: 'y'; + }; +}>; diff --git a/src/scrollingframe/src/Client/ScrollModel.d.ts b/src/scrollingframe/src/Client/ScrollModel.d.ts new file mode 100644 index 00000000000..0567ee9a683 --- /dev/null +++ b/src/scrollingframe/src/Client/ScrollModel.d.ts @@ -0,0 +1,26 @@ +interface ScrollModel { + TotalContentLength: number; + ViewSize: number; + Max: number; + readonly ContentMax: number; + Position: number; + readonly BackBounceInputRange: number; + readonly BackBounceRenderRange: number; + readonly ContentScrollPercentSize: number; + readonly RenderedContentScrollPercentSize: number; + ContentScrollPercent: number; + readonly RenderedContentScrollPercent: number; + readonly BoundedRenderPosition: number; + Velocity: number; + Target: number; + readonly AtRest: boolean; + GetDisplacementPastBounds(): number; + GetScale(timesOverBounds: number): number; +} + +interface ScrollModelConstructor { + readonly ClassName: 'ScrollModel'; + new (): ScrollModel; +} + +export const ScrollModel: ScrollModelConstructor; diff --git a/src/scrollingframe/src/Client/Scrollbar.d.ts b/src/scrollingframe/src/Client/Scrollbar.d.ts new file mode 100644 index 00000000000..d2bcba1154c --- /dev/null +++ b/src/scrollingframe/src/Client/Scrollbar.d.ts @@ -0,0 +1,17 @@ +import { ScrollType } from './SCROLL_TYPE'; + +interface Scrollbar { + SetScrollType(scrollType: ScrollType): void; + SetScrollingFrame(scrollingFrame: ScrollingFrame): void; + UpdateRender(): void; + Destroy(): void; +} + +interface ScrollbarConstructor { + readonly ClassName: 'Scrollbar'; + new (gui: GuiObject, scrollType?: ScrollType): Scrollbar; + + fromContainer(container: GuiObject, scrollType?: ScrollType): Scrollbar; +} + +export const Scrollbar: ScrollbarConstructor; diff --git a/src/scrollingframe/src/Client/ScrollingFrame.d.ts b/src/scrollingframe/src/Client/ScrollingFrame.d.ts new file mode 100644 index 00000000000..0f3e9dd5f7c --- /dev/null +++ b/src/scrollingframe/src/Client/ScrollingFrame.d.ts @@ -0,0 +1,35 @@ +import { ScrollType } from './SCROLL_TYPE'; +import { Scrollbar } from './Scrollbar'; +import { ScrollModel } from './ScrollModel'; + +export interface BindInputOptions { + OnClick?: (inputBeganObject: InputObject) => void; +} + +interface ScrollingFrame { + SetScrollType(scrollType: ScrollType): void; + AddScrollbar(scrollbar: Scrollbar): void; + RemoveScrollbar(scrollbar: Scrollbar): void; + ScrollTo(position: number): void; + ScrollToTop(doNotAnimate?: boolean): void; + ScrollToBottom(doNotAnimate?: boolean): void; + GetModel(): ScrollModel; + StopDrag(): void; + BindInput(gui: GuiObject, options?: BindInputOptions): void; + StartScrolling( + inputBeganObject: InputObject, + options?: BindInputOptions + ): void; + StartScrollbarScrolling( + scrollbarContainer: GuiObject, + inputBeganObject: InputObject + ): void; + Destroy(): void; +} + +interface ScrollingFrameConstructor { + readonly ClassName: 'ScrollingFrame'; + new (gui: GuiObject): ScrollingFrame; +} + +export const ScrollingFrame: ScrollingFrameConstructor; diff --git a/src/seatutils/index.d.ts b/src/seatutils/index.d.ts new file mode 100644 index 00000000000..2d5f137bcab --- /dev/null +++ b/src/seatutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxSeatUtils'; +export * from './src/Shared/SeatUtils'; diff --git a/src/seatutils/src/Shared/RxSeatUtils.d.ts b/src/seatutils/src/Shared/RxSeatUtils.d.ts new file mode 100644 index 00000000000..c69d18dc420 --- /dev/null +++ b/src/seatutils/src/Shared/RxSeatUtils.d.ts @@ -0,0 +1,11 @@ +import { Brio } from '../../../brio'; +import { Observable } from '../../../rx'; + +export namespace RxSeatUtils { + function observeOccupantBrio( + seat: Seat | VehicleSeat + ): Observable>; + function observeOccupant( + seat: Seat | VehicleSeat + ): Observable; +} diff --git a/src/seatutils/src/Shared/SeatUtils.d.ts b/src/seatutils/src/Shared/SeatUtils.d.ts new file mode 100644 index 00000000000..1a2dec7f9f7 --- /dev/null +++ b/src/seatutils/src/Shared/SeatUtils.d.ts @@ -0,0 +1,3 @@ +export namespace SeatUtils { + function getPlayerOccupants(seats: (Seat | VehicleSeat)[]): Player[]; +} diff --git a/src/secrets/index.d.ts b/src/secrets/index.d.ts new file mode 100644 index 00000000000..d91c3403c95 --- /dev/null +++ b/src/secrets/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/SecretsServiceClient'; +export * from './src/Server/Cmdr/SecretsCommandService'; +export * from './src/Server/SecretsService'; +export * from './src/Shared/Cmdr/SecretsCmdrTypeUtils'; +export * from './src/Shared/SecretsServiceConstants'; diff --git a/src/secrets/src/Client/SecretsServiceClient.d.ts b/src/secrets/src/Client/SecretsServiceClient.d.ts new file mode 100644 index 00000000000..99d8f8647f7 --- /dev/null +++ b/src/secrets/src/Client/SecretsServiceClient.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface SecretsServiceClient { + readonly ServiceName: 'SecretsServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + PromiseSecretKeyNamesList(): Promise; + Destroy(): void; +} diff --git a/src/secrets/src/Server/Cmdr/SecretsCommandService.d.ts b/src/secrets/src/Server/Cmdr/SecretsCommandService.d.ts new file mode 100644 index 00000000000..fec387d1c3a --- /dev/null +++ b/src/secrets/src/Server/Cmdr/SecretsCommandService.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SecretsCommandService { + readonly ServiceName: 'SecretsCommandService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/secrets/src/Server/SecretsService.d.ts b/src/secrets/src/Server/SecretsService.d.ts new file mode 100644 index 00000000000..d92b64d23fb --- /dev/null +++ b/src/secrets/src/Server/SecretsService.d.ts @@ -0,0 +1,18 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface SecretsService { + readonly ServiceName: 'SecretsService'; + Init(serviceBag: ServiceBag): void; + SetPublicKeySeed(seed: number): void; + Start(): void; + PromiseSecret(secretKey: string): Promise; + PromiseAllSecrets(): Promise; + ObserveSecret(secretKey: string): Observable; + DeleteSecret(secretKey: string): Promise; + StoreSecret(secretKey: string, value: string): void; + ClearAllSecrets(): Promise; + PromiseSecretKeyNamesList(): Promise; + Destroy(): void; +} diff --git a/src/secrets/src/Shared/Cmdr/SecretsCmdrTypeUtils.d.ts b/src/secrets/src/Shared/Cmdr/SecretsCmdrTypeUtils.d.ts new file mode 100644 index 00000000000..e5cba4a629f --- /dev/null +++ b/src/secrets/src/Shared/Cmdr/SecretsCmdrTypeUtils.d.ts @@ -0,0 +1,13 @@ +import { SecretsService } from '../../Server/SecretsService'; + +export namespace SecretsCmdrTypeUtils { + function registerSecretKeyTypes( + cmdr: unknown, + secretsService: SecretsService + ): void; + function makeSecretKeyType( + cmdr: unknown, + secretsService: SecretsService, + isRequired: boolean + ): unknown; +} diff --git a/src/secrets/src/Shared/SecretsServiceConstants.d.ts b/src/secrets/src/Shared/SecretsServiceConstants.d.ts new file mode 100644 index 00000000000..4117040ff29 --- /dev/null +++ b/src/secrets/src/Shared/SecretsServiceConstants.d.ts @@ -0,0 +1,4 @@ +export const SecretsServiceConstants: Readonly<{ + REMOTE_FUNCTION_NAME: 'SecretsServiceRemoteFunction'; + REQUEST_SECRET_KEY_NAMES_LIST: 'requestSecretKeyNamesList'; +}>; diff --git a/src/selectionimageutils/index.d.ts b/src/selectionimageutils/index.d.ts new file mode 100644 index 00000000000..2bc295d74d9 --- /dev/null +++ b/src/selectionimageutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/SelectionImageUtils'; diff --git a/src/selectionimageutils/src/Client/SelectionImageUtils.d.ts b/src/selectionimageutils/src/Client/SelectionImageUtils.d.ts new file mode 100644 index 00000000000..397c1593308 --- /dev/null +++ b/src/selectionimageutils/src/Client/SelectionImageUtils.d.ts @@ -0,0 +1,3 @@ +export namespace SelectionImageUtils { + function overrideWithBlank(button: GuiButton): ImageLabel; +} diff --git a/src/selectionutils/index.d.ts b/src/selectionutils/index.d.ts new file mode 100644 index 00000000000..afcad1fc18f --- /dev/null +++ b/src/selectionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RxSelectionUtils'; diff --git a/src/selectionutils/src/Shared/RxSelectionUtils.d.ts b/src/selectionutils/src/Shared/RxSelectionUtils.d.ts new file mode 100644 index 00000000000..113c2972c26 --- /dev/null +++ b/src/selectionutils/src/Shared/RxSelectionUtils.d.ts @@ -0,0 +1,21 @@ +import { Brio } from '@quenty/brio'; +import { Observable, Predicate } from '@quenty/rx'; + +export namespace RxSelectionUtils { + function observeFirstSelectionWhichIsA( + className: keyof Instances + ): Observable; + function observeFirstSelectionWhichIsABrio( + className: keyof Instances + ): Observable; + function observeFirstAdornee(): Observable; + function observeAdorneesBrio(): Observable>; + function observeFirstSelection( + where: Predicate + ): Observable; + function observeFirstSelectionBrio( + where: Predicate + ): Observable>; + function observeSelectionList(): Observable; + function observeSelectionItemsBrio(): Observable>; +} diff --git a/src/servicebag/index.d.ts b/src/servicebag/index.d.ts new file mode 100644 index 00000000000..4ddb6bf68b6 --- /dev/null +++ b/src/servicebag/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/ServiceBag'; diff --git a/src/servicebag/src/Shared/ServiceBag.d.ts b/src/servicebag/src/Shared/ServiceBag.d.ts new file mode 100644 index 00000000000..0096c6d56eb --- /dev/null +++ b/src/servicebag/src/Shared/ServiceBag.d.ts @@ -0,0 +1,21 @@ +interface ServiceBag { + PrintInitialization(): void; + GetService unknown>( + service: T + ): InstanceType; + GetService(service: T): T; + HasService(service: any): boolean; + Init(): void; + Start(): void; + IsStarted(): boolean; + Destroy(): void; +} + +interface ServiceBagConstructor { + readonly ClassName: 'ServiceBag'; + new (): ServiceBag; + + isServiceBag: (value: unknown) => value is ServiceBag; +} + +export const ServiceBag: ServiceBagConstructor; diff --git a/src/servicebag/src/Shared/ServiceInitLogger.d.ts b/src/servicebag/src/Shared/ServiceInitLogger.d.ts new file mode 100644 index 00000000000..a0500b27005 --- /dev/null +++ b/src/servicebag/src/Shared/ServiceInitLogger.d.ts @@ -0,0 +1,11 @@ +interface ServiceInitLogger { + StartInitClock(serviceName: string): void; + Print(): void; +} + +interface ServiceInitLoggerConstructor { + readonly ClassName: 'ServiceInitLogger'; + new (action: string): ServiceInitLogger; +} + +export const ServiceInitLogger: ServiceInitLoggerConstructor; diff --git a/src/setmechanismcframe/index.d.ts b/src/setmechanismcframe/index.d.ts new file mode 100644 index 00000000000..e4a020b18ef --- /dev/null +++ b/src/setmechanismcframe/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/setMechanismCFrame'; diff --git a/src/setmechanismcframe/src/Shared/setMechanismCFrame.d.ts b/src/setmechanismcframe/src/Shared/setMechanismCFrame.d.ts new file mode 100644 index 00000000000..c7f285b136a --- /dev/null +++ b/src/setmechanismcframe/src/Shared/setMechanismCFrame.d.ts @@ -0,0 +1,5 @@ +export const setMechanismCFrame: ( + originParts: Instance | BasePart[], + relativeTo: CFrame, + newCFrame: CFrame +) => void; diff --git a/src/settings-inputkeymap/index.d.ts b/src/settings-inputkeymap/index.d.ts new file mode 100644 index 00000000000..fa386a01278 --- /dev/null +++ b/src/settings-inputkeymap/index.d.ts @@ -0,0 +1,6 @@ +export * from './src/Client/InputKeyMapSettingClient'; +export * from './src/Client/SettingsInputKeyMapServiceClient'; +export * from './src/Server/InputKeyMapSetting'; +export * from './src/Server/SettingsInputKeyMapService'; +export * from './src/Shared/InputKeyMapSettingConstants'; +export * from './src/Shared/InputKeyMapSettingUtils'; diff --git a/src/settings-inputkeymap/src/Client/InputKeyMapSettingClient.d.ts b/src/settings-inputkeymap/src/Client/InputKeyMapSettingClient.d.ts new file mode 100644 index 00000000000..c8e7b5936de --- /dev/null +++ b/src/settings-inputkeymap/src/Client/InputKeyMapSettingClient.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { InputKeyMapList } from '@quenty/inputkeymaputils'; +import { ServiceBag } from '@quenty/servicebag'; + +interface InputKeyMapSettingClient extends BaseObject {} + +interface InputKeyMapSettingClientConstructor { + readonly ClassName: 'InputKeyMapSettingClient'; + new ( + serviceBag: ServiceBag, + inputKeyMapList: InputKeyMapList + ): InputKeyMapSettingClient; +} + +export const InputKeyMapSettingClient: InputKeyMapSettingClientConstructor; diff --git a/src/settings-inputkeymap/src/Client/SettingsInputKeyMapServiceClient.d.ts b/src/settings-inputkeymap/src/Client/SettingsInputKeyMapServiceClient.d.ts new file mode 100644 index 00000000000..28080e6dfe5 --- /dev/null +++ b/src/settings-inputkeymap/src/Client/SettingsInputKeyMapServiceClient.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SettingsInputKeyMapServiceClient { + readonly ServiceName: 'SettingsInputKeyMapServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/settings-inputkeymap/src/Server/InputKeyMapSetting.d.ts b/src/settings-inputkeymap/src/Server/InputKeyMapSetting.d.ts new file mode 100644 index 00000000000..0af3ea0fa3b --- /dev/null +++ b/src/settings-inputkeymap/src/Server/InputKeyMapSetting.d.ts @@ -0,0 +1,15 @@ +import { BaseObject } from '@quenty/baseobject'; +import { InputKeyMapList } from '@quenty/inputkeymaputils'; +import { ServiceBag } from '@quenty/servicebag'; + +interface InputKeyMapSetting extends BaseObject {} + +interface InputKeyMapSettingConstructor { + readonly ClassName: 'InputKeyMapSetting'; + new ( + serviceBag: ServiceBag, + inputKeyMapList: InputKeyMapList + ): InputKeyMapSetting; +} + +export const InputKeyMapSetting: InputKeyMapSettingConstructor; diff --git a/src/settings-inputkeymap/src/Server/SettingsInputKeyMapService.d.ts b/src/settings-inputkeymap/src/Server/SettingsInputKeyMapService.d.ts new file mode 100644 index 00000000000..59fae0cc8aa --- /dev/null +++ b/src/settings-inputkeymap/src/Server/SettingsInputKeyMapService.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SettingsInputKeyMapService { + readonly ServiceName: 'SettingsInputKeyMapService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/settings-inputkeymap/src/Shared/InputKeyMapSettingConstants.d.ts b/src/settings-inputkeymap/src/Shared/InputKeyMapSettingConstants.d.ts new file mode 100644 index 00000000000..f6b4ad55d3d --- /dev/null +++ b/src/settings-inputkeymap/src/Shared/InputKeyMapSettingConstants.d.ts @@ -0,0 +1,3 @@ +export const InputKeyMapSettingConstants: Readonly<{ + DEFAULT_VALUE: 'default'; +}>; diff --git a/src/settings-inputkeymap/src/Shared/InputKeyMapSettingUtils.d.ts b/src/settings-inputkeymap/src/Shared/InputKeyMapSettingUtils.d.ts new file mode 100644 index 00000000000..c231115481b --- /dev/null +++ b/src/settings-inputkeymap/src/Shared/InputKeyMapSettingUtils.d.ts @@ -0,0 +1,15 @@ +import { InputKeyMapList, InputType } from '@quenty/inputkeymaputils'; +import { InputModeType } from '@quenty/inputmode'; + +export type EncodedInputTypeList = string & { + __brand: 'EncodedInputTypeList'; +}; + +export namespace InputKeyMapSettingUtils { + function getSettingName( + inputKeyMapList: InputKeyMapList, + inputModeType: InputModeType + ): string; + function encodeInputTypeList(list: InputType[]): EncodedInputTypeList; + function decodeInputTypeList(encoded: EncodedInputTypeList): InputType[]; +} diff --git a/src/settings/index.d.ts b/src/settings/index.d.ts new file mode 100644 index 00000000000..23da36db419 --- /dev/null +++ b/src/settings/index.d.ts @@ -0,0 +1,15 @@ +export * from './src/Client/Player/PlayerSettingsClient'; +export * from './src/Client/SettingsServiceClient'; +export * from './src/Server/Cmdr/SettingsCmdrService'; +export * from './src/Server/Player/PlayerHasSettings'; +export * from './src/Server/Player/PlayerSettings'; +export * from './src/Server/SettingsService'; +export * from './src/Shared/Cmdr/SettingsCmdrUtils'; +export * from './src/Shared/Interface/PlayerSettingsInterface'; +export * from './src/Shared/Player/PlayerSettingsBase'; +export * from './src/Shared/Player/PlayerSettingsConstants'; +export * from './src/Shared/Player/PlayerSettingsUtils'; +export * from './src/Shared/Setting/SettingDefinition'; +export * from './src/Shared/Setting/SettingDefinitionProvider'; +export * from './src/Shared/Setting/SettingProperty'; +export * from './src/Shared/SettingsDataService'; diff --git a/src/settings/index.d.ts-inputkeymap b/src/settings/index.d.ts-inputkeymap new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/settings/src/Client/Player/PlayerSettingsClient.d.ts b/src/settings/src/Client/Player/PlayerSettingsClient.d.ts new file mode 100644 index 00000000000..797cb6b8b41 --- /dev/null +++ b/src/settings/src/Client/Player/PlayerSettingsClient.d.ts @@ -0,0 +1,20 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerSettingsBase } from '../../Shared/Player/PlayerSettingsBase'; +import { Observable } from '@quenty/rx'; +import { Binder } from '@quenty/binder'; + +interface PlayerSettingsClient extends PlayerSettingsBase { + GetValue(settingName: string, defaultValue: NonNullable): T; + ObserveValue( + settingName: string, + defaultValue: NonNullable + ): Observable; + SetValue(settingName: string, value: unknown): void; +} + +interface PlayerSettingsClientConstructor { + readonly ClassName: 'PlayerSettingsClient'; + new (folder: Folder, serviceBag: ServiceBag): PlayerSettingsClient; +} + +export const PlayerSettingsClient: Binder; diff --git a/src/settings/src/Client/SettingsServiceClient.d.ts b/src/settings/src/Client/SettingsServiceClient.d.ts new file mode 100644 index 00000000000..5d307343a70 --- /dev/null +++ b/src/settings/src/Client/SettingsServiceClient.d.ts @@ -0,0 +1,30 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerSettingsClient } from './Player/PlayerSettingsClient'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { Promise } from '@quenty/promise'; +import { CancelToken } from '@quenty/canceltoken'; + +export interface SettingsServiceClient { + readonly ServiceName: 'SettingsServiceClient'; + Init(serviceBag: ServiceBag): void; + Start(): void; + GetLocalPlayerSettings(): PlayerSettingsClient | undefined; + ObserveLocalPlayerSettingsBrio(): Observable>; + ObserveLocalPlayerSettings(): Observable; + PromiseLocalPlayerSettings( + cancelToken?: CancelToken + ): Promise; + ObservePlayerSettings( + player: Player + ): Observable; + ObservePlayerSettingsBrio( + player: Player + ): Observable>; + GetPlayerSettings(player: Player): PlayerSettingsClient | undefined; + PromisePlayerSettings( + player: Player, + cancelToken?: CancelToken + ): Promise; + Destroy(): void; +} diff --git a/src/settings/src/Server/Cmdr/SettingsCmdrService.d.ts b/src/settings/src/Server/Cmdr/SettingsCmdrService.d.ts new file mode 100644 index 00000000000..477df3fbddc --- /dev/null +++ b/src/settings/src/Server/Cmdr/SettingsCmdrService.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SettingsCmdrService { + readonly ServiceName: 'SettingsCmdrService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/settings/src/Server/Player/PlayerHasSettings.d.ts b/src/settings/src/Server/Player/PlayerHasSettings.d.ts new file mode 100644 index 00000000000..838b645995c --- /dev/null +++ b/src/settings/src/Server/Player/PlayerHasSettings.d.ts @@ -0,0 +1,12 @@ +import { BaseObject } from '@quenty/baseobject'; +import { PlayerBinder } from '@quenty/playerbinder'; +import { ServiceBag } from '@quenty/servicebag'; + +interface PlayerHasSettings extends BaseObject {} + +interface PlayerHasSettingsConstructor { + readonly ClassName: 'PlayerHasSettings'; + new (player: Player, serviceBag: ServiceBag): PlayerHasSettings; +} + +export const PlayerHasSettings: PlayerBinder; diff --git a/src/settings/src/Server/Player/PlayerSettings.d.ts b/src/settings/src/Server/Player/PlayerSettings.d.ts new file mode 100644 index 00000000000..8c2ae236d03 --- /dev/null +++ b/src/settings/src/Server/Player/PlayerSettings.d.ts @@ -0,0 +1,17 @@ +import { Binder } from '@quenty/binder'; +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerSettingsBase } from '../../Shared/Player/PlayerSettingsBase'; + +interface PlayerSettings extends PlayerSettingsBase { + EnsureInitialized( + settingName: string, + defaultValue: NonNullable + ): void; +} + +interface PlayerSettingsConstructor { + readonly ClassName: 'PlayerSettings'; + new (folder: Folder, serviceBag: ServiceBag): PlayerSettings; +} + +export const PlayerSettings: Binder; diff --git a/src/settings/src/Server/SettingsService.d.ts b/src/settings/src/Server/SettingsService.d.ts new file mode 100644 index 00000000000..7a3a95e6b24 --- /dev/null +++ b/src/settings/src/Server/SettingsService.d.ts @@ -0,0 +1,19 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { PlayerSettings } from './Player/PlayerSettings'; +import { Promise } from '@quenty/promise'; +import { CancelToken } from '@quenty/canceltoken'; + +export interface SettingsService { + readonly ServiceName: 'SettingsService'; + Init(serviceBag: ServiceBag): void; + ObservePlayerSettingsBrio(player: Player): Observable>; + ObservePlayerSettings(player: Player): Observable; + GetPlayerSettings(player: Player): PlayerSettings; + PromisePlayerSettings( + player: Player, + cancelToken?: CancelToken + ): Promise; + Destroy(): void; +} diff --git a/src/settings/src/Shared/Cmdr/SettingsCmdrUtils.d.ts b/src/settings/src/Shared/Cmdr/SettingsCmdrUtils.d.ts new file mode 100644 index 00000000000..3ef31ad7354 --- /dev/null +++ b/src/settings/src/Shared/Cmdr/SettingsCmdrUtils.d.ts @@ -0,0 +1,9 @@ +import { Cmdr, CmdrClient } from '@quenty/cmdrservice'; +import { ServiceBag } from '@quenty/servicebag'; + +export namespace SettingsCmdrUtils { + function registerSettingDefinition( + cmdr: Cmdr | CmdrClient, + serviceBag: ServiceBag + ): void; +} diff --git a/src/settings/src/Shared/Interface/PlayerSettingsInterface.d.ts b/src/settings/src/Shared/Interface/PlayerSettingsInterface.d.ts new file mode 100644 index 00000000000..8f44118a333 --- /dev/null +++ b/src/settings/src/Shared/Interface/PlayerSettingsInterface.d.ts @@ -0,0 +1,11 @@ +import { TieDefinition, TieDefinitionMethod } from '@quenty/tie'; + +export const PlayerSettingsInterface: TieDefinition<{ + GetSettingProperty: TieDefinitionMethod; + GetValue: TieDefinitionMethod; + SetValue: TieDefinitionMethod; + ObserveValue: TieDefinitionMethod; + RestoreDefault: TieDefinitionMethod; + EnsureInitialized: TieDefinitionMethod; + GetPlayer: TieDefinitionMethod; +}>; diff --git a/src/settings/src/Shared/Player/PlayerSettingsBase.d.ts b/src/settings/src/Shared/Player/PlayerSettingsBase.d.ts new file mode 100644 index 00000000000..a23c8f45cf1 --- /dev/null +++ b/src/settings/src/Shared/Player/PlayerSettingsBase.d.ts @@ -0,0 +1,27 @@ +import { BaseObject } from '@quenty/baseobject'; +import { ServiceBag } from '@quenty/servicebag'; +import { SettingDefinition } from '../Setting/SettingDefinition'; +import { Observable } from '@quenty/rx'; + +interface PlayerSettingsBase extends BaseObject { + GetPlayer(): Player | undefined; + GetFolder(): Folder; + GetSettingProperty( + settingName: string, + defaultValue: unknown + ): SettingDefinition; + GetValue(settingName: string, defaultValue: NonNullable): unknown; + SetValue(setingName: string, value: NonNullable): void; + ObserveValue( + settingName: string, + defaultValue: NonNullable + ): Observable; + RestoreDefault(settingName: string, defaultValue: NonNullable): void; +} + +interface PlayerSettingsBaseConstructor { + readonly ClassName: 'PlayerSettingsBase'; + new (folder: Folder, serviceBag: ServiceBag): PlayerSettingsBase; +} + +export const PlayerSettingsBase: PlayerSettingsBaseConstructor; diff --git a/src/settings/src/Shared/Player/PlayerSettingsConstants.d.ts b/src/settings/src/Shared/Player/PlayerSettingsConstants.d.ts new file mode 100644 index 00000000000..0cbb6c6b1af --- /dev/null +++ b/src/settings/src/Shared/Player/PlayerSettingsConstants.d.ts @@ -0,0 +1,10 @@ +export const PlayerSettingsConstants: Readonly<{ + SETTING_ATTRIBUTE_PREFIX: 'Setting_'; + SETTING_DEFAULT_VALUE_SUFFIX: '_Default'; + SETTING_LOCAL_USER_VALUE_SUFFIX: '_Client'; + + PLAYER_SETTINGS_NAME: 'PlayerSettings'; + REMOTE_FUNCTION_NAME: 'PlayerSettingsRemoteFunction'; + REQUEST_UPDATE_SETTINGS: 'requestUpdateSettings'; + MAX_SETTINGS_LENGTH: 2048; +}>; diff --git a/src/settings/src/Shared/Player/PlayerSettingsUtils.d.ts b/src/settings/src/Shared/Player/PlayerSettingsUtils.d.ts new file mode 100644 index 00000000000..6684f221c94 --- /dev/null +++ b/src/settings/src/Shared/Player/PlayerSettingsUtils.d.ts @@ -0,0 +1,10 @@ +export namespace PlayerSettingsUtils { + function create(): Folder; + function getAttributeName(settingName: string): string; + function getSettingName(attributeName: string): string; + function isSettingAttribute(attributeName: string): boolean; + function encodeForNetwork(settingValue: unknown): string; + function decodeForNetwork(settingValue: string): unknown; + function encodeForAttribute(settingValue: unknown): unknown; + function decodeForAttribute(settingValue: unknown): unknown; +} diff --git a/src/settings/src/Shared/Setting/SettingDefinition.d.ts b/src/settings/src/Shared/Setting/SettingDefinition.d.ts new file mode 100644 index 00000000000..d2acfc2ffae --- /dev/null +++ b/src/settings/src/Shared/Setting/SettingDefinition.d.ts @@ -0,0 +1,34 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; +import { SettingProperty } from './SettingProperty'; + +interface SettingDefinition { + Init(serviceBag: ServiceBag): void; + Get(player: Player): T; + Set(player: Player, value: T): void; + Promise(player: Player): Promise; + PromiseSet(player: Player, value: T): Promise; + Observe(player: Player): Observable; + GetSettingProperty( + serviceBag: ServiceBag, + player?: Player + ): SettingProperty; + GetLocalPlayerSettingProperty(serviceBag: ServiceBag): SettingProperty; + GetSettingName(): string; + GetDefaultValue(): T; + Destroy(): void; +} + +interface SettingDefinitionConstructor { + readonly ClassName: 'SettingDefinition'; + readonly ServiceName: 'SettingDefinition'; + new ( + settingName: string, + defaultValue: NonNullable + ): SettingDefinition; + + isSettingDefinition: (value: unknown) => value is SettingDefinition; +} + +export const SettingDefinition: SettingDefinitionConstructor; diff --git a/src/settings/src/Shared/Setting/SettingDefinitionProvider.d.ts b/src/settings/src/Shared/Setting/SettingDefinitionProvider.d.ts new file mode 100644 index 00000000000..80f8308ee87 --- /dev/null +++ b/src/settings/src/Shared/Setting/SettingDefinitionProvider.d.ts @@ -0,0 +1,38 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { SettingDefinition } from './SettingDefinition'; + +type ToValueMap< + T extends Record | NonNullable> +> = { + [K in keyof T]: T[K] extends SettingDefinition + ? U + : T[K] extends NonNullable + ? V + : never; +}; + +type SettingDefinitionProvider< + T extends Record | NonNullable> +> = { + [K in keyof T]: SettingDefinition[K]>; +} & { + Init(serviceBag: ServiceBag): void; + Start(): void; + GetSettingDefinitions(): { + [K in keyof T]: SettingDefinition[K]>; + }; + Get(settingName: K): SettingDefinition[K]>; + Destroy(): void; +}; + +interface SettingDefinitionProviderConstructor { + readonly ClassName: 'SettingDefinitionProvider'; + readonly ServiceName: 'SettingDefinitionProvider'; + new < + T extends Record | NonNullable> + >( + settingDefinitions: T + ): SettingDefinitionProvider; +} + +export const SettingDefinitionProvider: SettingDefinitionProviderConstructor; diff --git a/src/settings/src/Shared/Setting/SettingProperty.d.ts b/src/settings/src/Shared/Setting/SettingProperty.d.ts new file mode 100644 index 00000000000..149cb74e2b4 --- /dev/null +++ b/src/settings/src/Shared/Setting/SettingProperty.d.ts @@ -0,0 +1,28 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { SettingDefinition } from './SettingDefinition'; +import { Signal } from '@quenty/signal'; +import { Observable } from '@quenty/rx'; +import { Promise } from '@quenty/promise'; + +interface SettingProperty { + Value: T; + readonly Changed: Signal; + readonly DefaultValue: T; + Observe(): Observable; + SetValue(value: T): void; + PromiseValue(): Promise; + PromiseSetValue(value: T): Promise; + RestoreDefault(): void; + PromiseRestoreDefault(): Promise; +} + +interface SettingPropertyConstructor { + readonly ClassName: 'SettingProperty'; + new ( + serviceBag: ServiceBag, + player: Player, + definition: SettingDefinition + ): SettingProperty; +} + +export const SettingProperty: SettingPropertyConstructor; diff --git a/src/settings/src/Shared/SettingsDataService.d.ts b/src/settings/src/Shared/SettingsDataService.d.ts new file mode 100644 index 00000000000..6e42b830fb3 --- /dev/null +++ b/src/settings/src/Shared/SettingsDataService.d.ts @@ -0,0 +1,27 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { SettingDefinition } from './Setting/SettingDefinition'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { PlayerSettingsBase } from './Player/PlayerSettingsBase'; +import { CancelToken } from '@quenty/canceltoken'; +import { Promise } from '@quenty/promise'; + +export interface SettingsDataService { + readonly ServiceName: 'SettingsDataService'; + Init(serviceBag: ServiceBag): void; + GetSettingDefinitions(): SettingDefinition[]; + RegisterSettingDefinition(definition: SettingDefinition): () => void; + ObserveRegisteredDefinitionsBrio(): Observable< + Brio> + >; + ObservePlayerSettings(player: Player): Observable; + ObservePlayerSettingsBrio( + player: Player + ): Observable>; + PromisePlayerSettings( + player: Player, + cancelToken?: CancelToken + ): Promise; + GetPlayerSettings(player: Player): PlayerSettingsBase; + Destroy(): void; +} diff --git a/src/signal/index.d.ts b/src/signal/index.d.ts new file mode 100644 index 00000000000..be012da4609 --- /dev/null +++ b/src/signal/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Signal'; diff --git a/src/signal/src/Shared/Signal.d.ts b/src/signal/src/Shared/Signal.d.ts new file mode 100644 index 00000000000..0265fbaa38c --- /dev/null +++ b/src/signal/src/Shared/Signal.d.ts @@ -0,0 +1,30 @@ +type ToTuple = [T] extends [LuaTuple] ? V : [T]; + +export type SignalLike = + | Signal + | RBXScriptSignal<(...args: T extends LuaTuple ? V : [T]) => void>; + +interface Connection { + IsConnected(): boolean; + Disconnect(): void; + Destroy(): void; +} + +export interface Signal { + Fire(...args: ToTuple): void; + Connect(callback: (...args: ToTuple) => void): Connection; + DisconnectAll(): void; + Wait(): T extends void ? void : T extends LuaTuple ? LuaTuple : T; + Once(callback: (...args: ToTuple) => void): Connection; + Destroy(): void; +} + +interface SignalConstructor { + readonly ClassName: 'Signal'; + isSignal: (value: unknown) => value is Signal; + new (): Signal; +} + +export const Signal: SignalConstructor; + +export {}; diff --git a/src/singleton/index.d.ts b/src/singleton/index.d.ts new file mode 100644 index 00000000000..9387296728d --- /dev/null +++ b/src/singleton/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Singleton'; diff --git a/src/singleton/src/Shared/Singleton.d.ts b/src/singleton/src/Shared/Singleton.d.ts new file mode 100644 index 00000000000..4815731c75a --- /dev/null +++ b/src/singleton/src/Shared/Singleton.d.ts @@ -0,0 +1,15 @@ +import { ServiceBag } from '@quenty/servicebag'; + +interface Singleton { + Init(serviceBag: ServiceBag): void; +} + +interface SingletonConstructor { + readonly ClassName: 'Singleton'; + new ( + serviceName: string, + constructor: (...args: unknown[]) => unknown + ): Singleton; +} + +export const Singleton: SingletonConstructor; diff --git a/src/snackbar/index.d.ts b/src/snackbar/index.d.ts new file mode 100644 index 00000000000..f2e3b45709f --- /dev/null +++ b/src/snackbar/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/Gui/Snackbar'; +export * from './src/Client/SnackbarScreenGuiProvider'; +export * from './src/Client/SnackbarServiceClient'; +export * from './src/Server/SnackbarService'; +export * from './src/Shared/SnackbarOptionUtils'; diff --git a/src/snackbar/src/Client/Gui/Snackbar.d.ts b/src/snackbar/src/Client/Gui/Snackbar.d.ts new file mode 100644 index 00000000000..f1833c8f3b1 --- /dev/null +++ b/src/snackbar/src/Client/Gui/Snackbar.d.ts @@ -0,0 +1,16 @@ +import { TransitionModel } from '@quenty/transitionmodel'; +import { SnackbarOptions } from '../../Shared/SnackbarOptionUtils'; +import { Promise } from '@quenty/promise'; + +interface Snackbar extends TransitionModel { + PromiseSustain(): Promise; +} + +interface SnackbarConstructor { + readonly ClassName: 'Snackbar'; + new (text: string, options?: SnackbarOptions): Snackbar; + + isSnackbar: (value: unknown) => value is Snackbar; +} + +export const Snackbar: SnackbarConstructor; diff --git a/src/snackbar/src/Client/SnackbarScreenGuiProvider.d.ts b/src/snackbar/src/Client/SnackbarScreenGuiProvider.d.ts new file mode 100644 index 00000000000..25d5f943c16 --- /dev/null +++ b/src/snackbar/src/Client/SnackbarScreenGuiProvider.d.ts @@ -0,0 +1,5 @@ +import { GenericScreenGuiProvider } from '@quenty/genericscreenguiprovider'; + +export const SnackbarScreenGuiProvider: GenericScreenGuiProvider<{ + SNACKBAR: 0; +}>; diff --git a/src/snackbar/src/Client/SnackbarServiceClient.d.ts b/src/snackbar/src/Client/SnackbarServiceClient.d.ts new file mode 100644 index 00000000000..fa68162f941 --- /dev/null +++ b/src/snackbar/src/Client/SnackbarServiceClient.d.ts @@ -0,0 +1,18 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { SnackbarOptions } from '../Shared/SnackbarOptionUtils'; +import { Snackbar } from './Gui/Snackbar'; + +export interface SnackbarServiceClient { + readonly ClassName: 'SnackbarServiceClient'; + Init(serviceBag: ServiceBag): void; + SetScreenGui(screenGui: ScreenGui): void; + ShowSnackbar( + text: string, + options?: { + options?: SnackbarOptions; + } + ): Snackbar; + HideCurrent(doNotAnimate?: boolean): void; + ClearQueue(doNotAnimate?: boolean): void; + Destroy(): void; +} diff --git a/src/snackbar/src/Server/SnackbarService.d.ts b/src/snackbar/src/Server/SnackbarService.d.ts new file mode 100644 index 00000000000..761e016c9d7 --- /dev/null +++ b/src/snackbar/src/Server/SnackbarService.d.ts @@ -0,0 +1,5 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SnackbarService { + Init(serviceBag: ServiceBag): void; +} diff --git a/src/snackbar/src/Shared/SnackbarOptionUtils.d.ts b/src/snackbar/src/Shared/SnackbarOptionUtils.d.ts new file mode 100644 index 00000000000..13485302182 --- /dev/null +++ b/src/snackbar/src/Shared/SnackbarOptionUtils.d.ts @@ -0,0 +1,13 @@ +export type CallToActionOptions = { + Text: string; + OnClick?: () => void; +}; + +export type SnackbarOptions = { + CallToAction?: string | CallToActionOptions; +}; + +export namespace SnackbarOptionUtils { + function createSnackbarOptions(options: SnackbarOptions): SnackbarOptions; + function isSnackbarOptions(value: unknown): value is SnackbarOptions; +} diff --git a/src/socialserviceutils/index.d.ts b/src/socialserviceutils/index.d.ts new file mode 100644 index 00000000000..96c48091f29 --- /dev/null +++ b/src/socialserviceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/SocialServiceUtils'; diff --git a/src/socialserviceutils/src/Shared/SocialServiceUtils.d.ts b/src/socialserviceutils/src/Shared/SocialServiceUtils.d.ts new file mode 100644 index 00000000000..1f9ed18606f --- /dev/null +++ b/src/socialserviceutils/src/Shared/SocialServiceUtils.d.ts @@ -0,0 +1,9 @@ +import { Promise } from '@quenty/promise'; + +export namespace SocialServiceUtils { + function promiseCanSendGameInvite(player: Player): Promise; + function promisePromptGameInvite( + player: Player, + options?: ExperienceInviteOptions + ): Promise; +} diff --git a/src/softshutdown/index.d.ts b/src/softshutdown/index.d.ts new file mode 100644 index 00000000000..697861d6f78 --- /dev/null +++ b/src/softshutdown/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/SoftShutdownServiceClient'; +export * from './src/Client/SoftShutdownUI'; +export * from './src/Server/SoftShutdownService'; +export * from './src/Shared/SoftShutdownConstants'; +export * from './src/Shared/SoftShutdownTranslator'; diff --git a/src/softshutdown/src/Client/SoftShutdownServiceClient.d.ts b/src/softshutdown/src/Client/SoftShutdownServiceClient.d.ts new file mode 100644 index 00000000000..8dec018cb39 --- /dev/null +++ b/src/softshutdown/src/Client/SoftShutdownServiceClient.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SoftShutdownServiceClient { + readonly ServiceName: 'SoftShutdownServiceClient'; + Init(serviceBag: ServiceBag): void; + Destroy(): void; +} diff --git a/src/softshutdown/src/Client/SoftShutdownUI.d.ts b/src/softshutdown/src/Client/SoftShutdownUI.d.ts new file mode 100644 index 00000000000..7ab073b9474 --- /dev/null +++ b/src/softshutdown/src/Client/SoftShutdownUI.d.ts @@ -0,0 +1,14 @@ +import { BasicPane } from '@quenty/basicpane'; + +interface SoftShutdownUI extends BasicPane { + Gui: Frame; + SetTitle(text: string): void; + SetSubtitle(text: string): void; +} + +interface SoftShutdownUIConstructor { + readonly ClassName: 'SoftShutdownUI'; + new (): SoftShutdownUI; +} + +export const SoftShutdownUI: SoftShutdownUIConstructor; diff --git a/src/softshutdown/src/Server/SoftShutdownService.d.ts b/src/softshutdown/src/Server/SoftShutdownService.d.ts new file mode 100644 index 00000000000..dc032f98c67 --- /dev/null +++ b/src/softshutdown/src/Server/SoftShutdownService.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SoftShutdownService { + readonly ServiceName: 'SoftShutdownService'; + Init(serviceBag: ServiceBag): void; + Destroy(): void; +} diff --git a/src/softshutdown/src/Shared/SoftShutdownConstants.d.ts b/src/softshutdown/src/Shared/SoftShutdownConstants.d.ts new file mode 100644 index 00000000000..08cb238c379 --- /dev/null +++ b/src/softshutdown/src/Shared/SoftShutdownConstants.d.ts @@ -0,0 +1,4 @@ +export const SoftShutdownConstants: Readonly<{ + IS_SOFT_SHUTDOWN_LOBBY_ATTRIBUTE: 'IsSoftShutdownLobby'; + IS_SOFT_SHUTDOWN_UPDATING_ATTRIBUTE: 'IsSoftshutdownRebootingServers'; +}>; diff --git a/src/softshutdown/src/Shared/SoftShutdownTranslator.d.ts b/src/softshutdown/src/Shared/SoftShutdownTranslator.d.ts new file mode 100644 index 00000000000..267f7301631 --- /dev/null +++ b/src/softshutdown/src/Shared/SoftShutdownTranslator.d.ts @@ -0,0 +1,3 @@ +import { JSONTranslator } from '@quenty/clienttranslator'; + +export const SoftShutdownTranslator: JSONTranslator; diff --git a/src/soundgroups/index.d.ts b/src/soundgroups/index.d.ts new file mode 100644 index 00000000000..6d88fa5709a --- /dev/null +++ b/src/soundgroups/index.d.ts @@ -0,0 +1,7 @@ +export * from './src/Client/SoundGroupServiceClient'; +export * from './src/Server/SoundGroupService'; +export * from './src/Shared/Effects/SoundEffectsList'; +export * from './src/Shared/Groups/WellKnownSoundGroups'; +export * from './src/Shared/SoundEffectService'; +export * from './src/Shared/SoundGroupTracker'; +export * from './src/Shared/Utils/SoundGroupPathUtils'; diff --git a/src/soundgroups/src/Client/SoundGroupServiceClient.d.ts b/src/soundgroups/src/Client/SoundGroupServiceClient.d.ts new file mode 100644 index 00000000000..a59b02e89a9 --- /dev/null +++ b/src/soundgroups/src/Client/SoundGroupServiceClient.d.ts @@ -0,0 +1,7 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SoundGroupServiceClient { + readonly ServiceName: 'SoundGroupServiceClient'; + Init(serviceBag: ServiceBag): void; + Destroy(): void; +} diff --git a/src/soundgroups/src/Server/SoundGroupService.d.ts b/src/soundgroups/src/Server/SoundGroupService.d.ts new file mode 100644 index 00000000000..ae628bfe84c --- /dev/null +++ b/src/soundgroups/src/Server/SoundGroupService.d.ts @@ -0,0 +1,8 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SoundGroupService { + readonly ServiceName: 'SoundGroupService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + Destroy(): void; +} diff --git a/src/soundgroups/src/Shared/Effects/SoundEffectsList.d.ts b/src/soundgroups/src/Shared/Effects/SoundEffectsList.d.ts new file mode 100644 index 00000000000..99212f4d675 --- /dev/null +++ b/src/soundgroups/src/Shared/Effects/SoundEffectsList.d.ts @@ -0,0 +1,23 @@ +import { MaidTask } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +export type SoundEffectApplier = ( + instance: SoundGroup | Sound +) => MaidTask | undefined; + +interface SoundEffectsList { + IsActiveChanged: Signal; + ObserveHasEffects(): Observable; + IsActive(): boolean; + PushEffect(effect: SoundEffectApplier): () => void; + ApplyEffects(instance: SoundGroup | Sound): () => void; + HasEffects(): boolean; +} + +interface SoundEffectsListConstructor { + readonly ClassName: 'SoundEffectsList'; + new (): SoundEffectsList; +} + +export const SoundEffectsList: SoundEffectsListConstructor; diff --git a/src/soundgroups/src/Shared/Effects/SoundEffectsRegistry.d.ts b/src/soundgroups/src/Shared/Effects/SoundEffectsRegistry.d.ts new file mode 100644 index 00000000000..bce3c5ffd0a --- /dev/null +++ b/src/soundgroups/src/Shared/Effects/SoundEffectsRegistry.d.ts @@ -0,0 +1,20 @@ +import { BaseObject } from '@quenty/baseobject'; +import { SoundEffectApplier } from './SoundEffectsList'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; + +interface SoundEffectsRegistry extends BaseObject { + PushEffect(soundGroupPath: string, effect: SoundEffectApplier): () => void; + ApplyEffects( + soundGroupPath: string, + instance: SoundGroup | Sound + ): () => void; + ObserveActiveEffectsPathBrios(): Observable>; +} + +interface SoundEffectsRegistryConstructor { + readonly ClassName: 'SoundEffectsRegistry'; + new (): SoundEffectsRegistry; +} + +export const SoundEffectsRegistry: SoundEffectsRegistryConstructor; diff --git a/src/soundgroups/src/Shared/Groups/WellKnownSoundGroups.d.ts b/src/soundgroups/src/Shared/Groups/WellKnownSoundGroups.d.ts new file mode 100644 index 00000000000..1aa2c79eebe --- /dev/null +++ b/src/soundgroups/src/Shared/Groups/WellKnownSoundGroups.d.ts @@ -0,0 +1,6 @@ +export const WellKnownSoundGroups: Readonly<{ + MASTER: 'Master'; + SFX: 'Master.SoundEffects'; + MUSIC: 'Master.Music'; + VOICE: 'Master.Voice'; +}>; diff --git a/src/soundgroups/src/Shared/SoundEffectService.d.ts b/src/soundgroups/src/Shared/SoundEffectService.d.ts new file mode 100644 index 00000000000..afe04c4a7a1 --- /dev/null +++ b/src/soundgroups/src/Shared/SoundEffectService.d.ts @@ -0,0 +1,17 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { SoundEffectApplier } from './Effects/SoundEffectsList'; + +export interface SoundEffectService { + readonly ServiceName: 'SoundEffectService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + RegisterSFX(sound: Sound, soundGroupPath?: string): void; + GetOrCreateSoundGroup(soundGroupPath: string): SoundGroup; + GetSoundGroup(soundGroupPath: string): SoundGroup; + PushEffect(soundGroupPath: string, effect: SoundEffectApplier): () => void; + ApplyEffects( + soundGroupPath: string, + instance: Sound | SoundGroup + ): () => void; + Destroy(): void; +} diff --git a/src/soundgroups/src/Shared/SoundGroupTracker.d.ts b/src/soundgroups/src/Shared/SoundGroupTracker.d.ts new file mode 100644 index 00000000000..ea49315d02b --- /dev/null +++ b/src/soundgroups/src/Shared/SoundGroupTracker.d.ts @@ -0,0 +1,18 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +interface SoundGroupTracker extends BaseObject { + GetFirstSoundGroup(soundGroupPath: string): SoundGroup | undefined; + ObserveSoundGroup(soundGroupPath: string): Observable; + ObserveSoundGroupBrio(soundGroupPath: string): Observable>; + ObserveSoundGroupsBrio(): Observable>; + ObserveSoundGroupPath(soundGroup: SoundGroup): Observable; +} + +interface SoundGroupTrackerConstructor { + readonly ClassName: 'SoundGroupTracker'; + new (root?: Instance): SoundGroupTracker; +} + +export const SoundGroupTracker: SoundGroupTrackerConstructor; diff --git a/src/soundgroups/src/Shared/Utils/SoundGroupPathUtils.d.ts b/src/soundgroups/src/Shared/Utils/SoundGroupPathUtils.d.ts new file mode 100644 index 00000000000..54faf2509e7 --- /dev/null +++ b/src/soundgroups/src/Shared/Utils/SoundGroupPathUtils.d.ts @@ -0,0 +1,12 @@ +export namespace SoundGroupPathUtils { + function isSoundGroupPath(soundGroupPath: unknown): soundGroupPath is string; + function toPathTable(soundGroupPath: string): string[]; + function findSoundGroup( + soundGroupPath: string, + root?: Instance + ): SoundGroup | undefined; + function findOrCreateSoundGroup( + soundGroupPath: string, + root?: Instance + ): SoundGroup; +} diff --git a/src/soundplayer/index.d.ts b/src/soundplayer/index.d.ts new file mode 100644 index 00000000000..8d86530c00b --- /dev/null +++ b/src/soundplayer/index.d.ts @@ -0,0 +1,4 @@ +export * from './src/Client/Loops/Layered/LayeredLoopedSoundPlayer'; +export * from './src/Client/Loops/LoopedSoundPlayer'; +export * from './src/Client/Loops/SimpleLoopedSoundPlayer'; +export * from './src/Client/Schedule/SoundLoopScheduleUtils'; diff --git a/src/soundplayer/src/Client/Loops/Layered/LayeredLoopedSoundPlayer.d.ts b/src/soundplayer/src/Client/Loops/Layered/LayeredLoopedSoundPlayer.d.ts new file mode 100644 index 00000000000..5190ab1daae --- /dev/null +++ b/src/soundplayer/src/Client/Loops/Layered/LayeredLoopedSoundPlayer.d.ts @@ -0,0 +1,51 @@ +import { SoundIdLike } from '@quenty/sounds'; +import { SpringTransitionModel } from '@quenty/transitionmodel'; +import { Mountable } from '@quenty/valueobject'; +import { SoundLoopSchedule } from '../../Schedule/SoundLoopScheduleUtils'; + +interface LayeredLoopedSoundPlayer extends SpringTransitionModel { + SetDefaultCrossFadeTime(crossFadeTime: Mountable): void; + SetVolumeMultiplier(volumeMultiplier: Mountable): void; + SetBPM(bpm: Mountable): void; + SetSoundParent(soundParent: Instance | undefined): void; + SetSoundGroup(soundGroup: SoundGroup | undefined): void; + Swap( + layerId: string, + soundId: SoundIdLike | undefined, + scheduleOptions?: SoundLoopSchedule + ): void; + SwapOnLoop( + layerId: string, + soundId: SoundIdLike | undefined, + scheduleOptions?: SoundLoopSchedule + ): void; + SwapToSamples( + layerId: string, + soundId: SoundIdLike | undefined, + scheduleOptions?: SoundLoopSchedule + ): void; + SwapToChoice( + layerId: string, + soundIdList: SoundIdLike[], + scheduleOptions?: SoundLoopSchedule + ): void; + PlayOnce( + layerId: string, + soundIdList: SoundIdLike[], + scheduleOptions?: SoundLoopSchedule + ): void; + PlayOnceOnLoop( + layerId: string, + soundId: SoundIdLike | undefined, + scheduleOptions?: SoundLoopSchedule + ): void; + StopLayer(layerId: string): void; + StopAll(): void; +} + +interface LayeredLoopedSoundPlayerConstructor { + readonly ClassName: 'LayeredLoopedSoundPlayer'; + new (soundParent?: Instance): LayeredLoopedSoundPlayer; +} + +export const LayeredLoopedSoundPlayer: LayeredLoopedSoundPlayerConstructor; diff --git a/src/soundplayer/src/Client/Loops/LoopedSoundPlayer.d.ts b/src/soundplayer/src/Client/Loops/LoopedSoundPlayer.d.ts new file mode 100644 index 00000000000..32d78fe2c53 --- /dev/null +++ b/src/soundplayer/src/Client/Loops/LoopedSoundPlayer.d.ts @@ -0,0 +1,48 @@ +import { SoundIdLike } from '@quenty/sounds'; +import { SpringTransitionModel } from '@quenty/transitionmodel'; +import { SoundLoopSchedule } from '../Schedule/SoundLoopScheduleUtils'; +import { Promise } from '@quenty/promise'; + +interface LoopedSoundPlayer extends SpringTransitionModel { + SetCrossFadeTime(crossFadeTime: number): void; + SetVolumeMultiplier(volume: number): void; + SetSoundGroup(soundGroup: SoundGroup | undefined): void; + SetBPM(bpm: number | undefined): void; + SetSoundParent(parent: Instance | undefined): void; + Swap( + soundId: SoundIdLike | undefined, + loopSchedule?: SoundLoopSchedule + ): void; + SetDoSyncSoundPlayback(doSyncSoundPlayback: boolean): void; + SwapToSamples( + soundIdList: SoundIdLike[], + loopSchedule?: SoundLoopSchedule + ): void; + SwapToChoice( + soundIdList: SoundIdLike[], + loopSchedule?: SoundLoopSchedule + ): void; + PlayOnce( + soundId: SoundIdLike | undefined, + loopSchedule?: SoundLoopSchedule + ): void; + SwapOnLoop( + soundId: SoundIdLike | undefined, + loopSchedule?: SoundLoopSchedule + ): void; + PlayOnceOnLoop( + soundId: SoundIdLike | undefined, + loopSchedule?: SoundLoopSchedule + ): void; + StopAfterLoop(): void; + PromiseLoopDone(): Promise; + PromiseSustain(): Promise; + GetSound(): Sound | undefined; +} + +interface LoopedSoundPlayerConstructor { + readonly ClassName: 'LoopedSoundPlayer'; + new (soundId?: SoundIdLike, soundParent?: Instance): LoopedSoundPlayer; +} + +export const LoopedSoundPlayer: LoopedSoundPlayerConstructor; diff --git a/src/soundplayer/src/Client/Loops/SimpleLoopedSoundPlayer.d.ts b/src/soundplayer/src/Client/Loops/SimpleLoopedSoundPlayer.d.ts new file mode 100644 index 00000000000..13dd2a26d17 --- /dev/null +++ b/src/soundplayer/src/Client/Loops/SimpleLoopedSoundPlayer.d.ts @@ -0,0 +1,17 @@ +import { Promise } from '@quenty/promise'; +import { SoundIdLike } from '@quenty/sounds'; +import { TimedTransitionModel } from '@quenty/transitionmodel'; + +interface SimpleLoopedSoundPlayer extends TimedTransitionModel { + SetSoundGroup(soundGroup: SoundGroup | undefined): void; + SetVolumeMultiplier(volume: number): void; + PromiseSustain(): Promise; + PromiseLoopDone(): Promise; +} + +interface SimpleLoopedSoundPlayerConstructor { + readonly ClassName: 'SimpleLoopedSoundPlayer'; + new (soundId: SoundIdLike): SimpleLoopedSoundPlayer; +} + +export const SimpleLoopedSoundPlayer: SimpleLoopedSoundPlayerConstructor; diff --git a/src/soundplayer/src/Client/Schedule/SoundLoopScheduleUtils.d.ts b/src/soundplayer/src/Client/Schedule/SoundLoopScheduleUtils.d.ts new file mode 100644 index 00000000000..35871d93614 --- /dev/null +++ b/src/soundplayer/src/Client/Schedule/SoundLoopScheduleUtils.d.ts @@ -0,0 +1,23 @@ +export interface SoundLoopSchedule { + playOnNextLoop?: boolean; + maxLoops?: number; + initialDelay?: number | NumberRange; + loopDelay?: number | NumberRange; + maxInitialWaitTimeForNextLoop?: number | NumberRange; +} + +export namespace SoundLoopScheduleUtils { + function schedule( + loopedSchedule: SoundLoopSchedule + ): Readonly; + function onNextLoop(loopedSchedule: SoundLoopSchedule): SoundLoopSchedule; + function maxLoops( + maxLoops: number, + loopedSchedule: SoundLoopSchedule + ): SoundLoopSchedule; + // reserved keyword + // function default(): SoundLoopSchedule; + function isWaitTimeSeconds(value: unknown): value is number | NumberRange; + function isLoopedSchedule(value: unknown): value is SoundLoopSchedule; + function getWaitTimeSeconds(waitTime: number | NumberRange): number; +} diff --git a/src/sounds/index.d.ts b/src/sounds/index.d.ts new file mode 100644 index 00000000000..91739a32e8d --- /dev/null +++ b/src/sounds/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/SoundPromiseUtils'; +export * from './src/Shared/SoundUtils'; diff --git a/src/sounds/src/Shared/SoundPromiseUtils.d.ts b/src/sounds/src/Shared/SoundPromiseUtils.d.ts new file mode 100644 index 00000000000..3a23cd4ab81 --- /dev/null +++ b/src/sounds/src/Shared/SoundPromiseUtils.d.ts @@ -0,0 +1,8 @@ +import { Promise } from '@quenty/promise'; + +export namespace SoundPromiseUtils { + function promiseLoaded(sound: Sound): Promise; + function promisePlayed(sound: Sound): Promise; + function promiseLooped(sound: Sound): Promise; + function promiseAllSoundsLoaded(sounds: Sound[]): Promise; +} diff --git a/src/sounds/src/Shared/SoundUtils.d.ts b/src/sounds/src/Shared/SoundUtils.d.ts new file mode 100644 index 00000000000..080c2fa0ffd --- /dev/null +++ b/src/sounds/src/Shared/SoundUtils.d.ts @@ -0,0 +1,22 @@ +import { TemplateProvider } from '@quenty/templateprovider'; + +type SoundIdLike = string | number | Partial>; + +export namespace SoundUtils { + function playFromId(id: SoundIdLike): Sound; + function createSoundFromId(id: SoundIdLike): Sound; + function applyPropertiesFromId(sound: Sound, id: SoundIdLike): void; + function playFromIdInParent(i: SoundIdLike, parent: Instance): Sound; + function removeAfterTimeLength(sound: Sound): void; + function playTemplate( + templates: TemplateProvider, + templateName: string + ): Sound; + function toRbxAssetId(id: SoundIdLike): string; + function isConvertableToRbxAsset(soundId: SoundIdLike): boolean; + function playTemplateInParent( + templates: TemplateProvider, + templateName: string, + parent: Instance + ): Sound; +} diff --git a/src/spawning/index.d.ts b/src/spawning/index.d.ts new file mode 100644 index 00000000000..0156250c705 --- /dev/null +++ b/src/spawning/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Client/SpawnServiceClient'; +export * from './src/Server/SpawnBinderGroupsServer'; +export * from './src/Server/SpawnCmdrService'; +export * from './src/Server/SpawnService'; +export * from './src/Shared/SpawnerUtils'; diff --git a/src/spawning/src/Client/SpawnServiceClient.d.ts b/src/spawning/src/Client/SpawnServiceClient.d.ts new file mode 100644 index 00000000000..2d039a2cea7 --- /dev/null +++ b/src/spawning/src/Client/SpawnServiceClient.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SpawnServiceClient { + readonly ServiceName: 'SpawnServiceClient'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/spawning/src/Server/SpawnBinderGroupsServer.d.ts b/src/spawning/src/Server/SpawnBinderGroupsServer.d.ts new file mode 100644 index 00000000000..828a2189501 --- /dev/null +++ b/src/spawning/src/Server/SpawnBinderGroupsServer.d.ts @@ -0,0 +1,3 @@ +import { BinderGroupProvider } from '@quenty/binder'; + +export const SpawnBinderGroupsServer: BinderGroupProvider; diff --git a/src/spawning/src/Server/SpawnCmdrService.d.ts b/src/spawning/src/Server/SpawnCmdrService.d.ts new file mode 100644 index 00000000000..d8caae79d91 --- /dev/null +++ b/src/spawning/src/Server/SpawnCmdrService.d.ts @@ -0,0 +1,6 @@ +import { ServiceBag } from '@quenty/servicebag'; + +export interface SpawnCmdrService { + readonly ServiceName: 'SpawnCmdrService'; + Init(serviceBag: ServiceBag): void; +} diff --git a/src/spawning/src/Server/SpawnService.d.ts b/src/spawning/src/Server/SpawnService.d.ts new file mode 100644 index 00000000000..6d0fbea7ae5 --- /dev/null +++ b/src/spawning/src/Server/SpawnService.d.ts @@ -0,0 +1,12 @@ +import { Binder } from '@quenty/binder'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface SpawnService { + readonly ServiceName: 'SpawnService'; + Init(serviceBag: ServiceBag): void; + Start(): void; + AddSpawnerBinder(spawnerBinder: Binder): void; + Regenerate(): void; + Update(): void; + Destroy(): void; +} diff --git a/src/spawning/src/Shared/SpawnerUtils.d.ts b/src/spawning/src/Shared/SpawnerUtils.d.ts new file mode 100644 index 00000000000..cd5f7fe0006 --- /dev/null +++ b/src/spawning/src/Shared/SpawnerUtils.d.ts @@ -0,0 +1,8 @@ +import { Raycaster } from '@quenty/raycaster'; + +export namespace SpawnerUtils { + function getSpawnLocation( + spawnPart: BasePart, + raycaster: Raycaster + ): LuaTuple<[position: Vector3, raycastResult?: RaycastResult]>; +} diff --git a/src/spring/index.d.ts b/src/spring/index.d.ts new file mode 100644 index 00000000000..f35fe008ab5 --- /dev/null +++ b/src/spring/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/LinearValue'; +export * from './src/Shared/Spring'; +export * from './src/Shared/SpringUtils'; diff --git a/src/spring/src/Shared/LinearValue.d.ts b/src/spring/src/Shared/LinearValue.d.ts new file mode 100644 index 00000000000..5644b91931c --- /dev/null +++ b/src/spring/src/Shared/LinearValue.d.ts @@ -0,0 +1,26 @@ +type ToTuple = T extends unknown[] ? T : [T]; + +type LinearValue = { + ToBaseValue(): T; + GetMagnitude(): number; + Magnitude: number; + __add(other: LinearValue): LinearValue; + __sub(other: LinearValue): LinearValue; + __mul(scalar: number): LinearValue; + __div(scalar: number): LinearValue; + __eq(other: LinearValue): boolean; +}; + +interface LinearValueConstructor { + readonly ClassName: 'LinearValue'; + new ( + constructor: (...values: number[]) => T, + values: number[] + ): LinearValue; + + isLinear: (value: unknown) => value is LinearValue; + toLinearIfNeeded: (value: T) => LinearValue | T; + fromLinearIfNeeded: (value: LinearValue | T) => T; +} + +export const LinearValue: LinearValueConstructor; diff --git a/src/spring/src/Shared/Spring.d.ts b/src/spring/src/Shared/Spring.d.ts new file mode 100644 index 00000000000..7b13bf76148 --- /dev/null +++ b/src/spring/src/Shared/Spring.d.ts @@ -0,0 +1,21 @@ +export type SpringClock = () => number; + +type Spring = { + Value: T; + Velocity: T; + Target: T; + Damper: number; + Speed: number; + Clock: () => number; + Impulse(velocity: T): void; + TimeSkip(delta: number): void; + SetTarget(value: T, doNotAnimate?: boolean): void; +}; + +interface SpringConstructor { + readonly ClassName: 'Spring'; + new (): Spring; + new (value: T, springClock?: SpringClock): Spring; +} + +export const Spring: SpringConstructor; diff --git a/src/spring/src/Shared/SpringUtils.d.ts b/src/spring/src/Shared/SpringUtils.d.ts new file mode 100644 index 00000000000..ae8f1301655 --- /dev/null +++ b/src/spring/src/Shared/SpringUtils.d.ts @@ -0,0 +1,16 @@ +import { LinearValue } from './LinearValue'; +import { Spring } from './Spring'; + +export namespace SpringUtils { + function animating( + spring: Spring, + epsilon?: number + ): LuaTuple<[boolean, T]>; + function getVelocityAdjustment( + velocity: T, + dampen: number, + speed: number + ): T; + function toLinearIfNeeded(value: T): LinearValue | T; + function fromLinearIfNeeded(value: LinearValue | T): T; +} diff --git a/src/sprites/index.d.ts b/src/sprites/index.d.ts new file mode 100644 index 00000000000..1003ff63b46 --- /dev/null +++ b/src/sprites/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/InputImageLibrary/index'; +export * from './src/Shared/Sprite/Sprite'; +export * from './src/Shared/Sprite/Spritesheet'; diff --git a/src/sprites/src/Shared/InputImageLibrary/index.d.ts b/src/sprites/src/Shared/InputImageLibrary/index.d.ts new file mode 100644 index 00000000000..371497b0c8f --- /dev/null +++ b/src/sprites/src/Shared/InputImageLibrary/index.d.ts @@ -0,0 +1,38 @@ +import { Sprite } from '../Sprite/Sprite'; +import { Spritesheet } from '../Sprite/Spritesheet'; + +interface InputImageLibrary { + GetPreloadAssetIds(): string[]; + GetSprite( + keyCode: unknown, + preferredStyle?: string, + preferredPlatform?: string + ): Sprite | undefined; + StyleImage( + gui: T, + keyCode: unknown, + preferredStyle?: string, + preferredPlatform?: string + ): T | undefined; + GetScaledImageLabel( + keyCode: unknown, + preferredStyle?: string, + preferredPlatform?: string + ): + | (ImageLabel & { + UIAspectRatioConstraint: UIAspectRatioConstraint; + }) + | undefined; + PickSheet( + keyCode: unknown, + preferredStyle?: string, + preferredPlatform?: string + ): Spritesheet; +} + +interface InputImageLibraryConstructor { + readonly ClassName: 'InputImageLibrary'; + new (parentFolder: Folder): InputImageLibrary; +} + +export const InputImageLibrary: InputImageLibrary; diff --git a/src/sprites/src/Shared/Sprite/Sprite.d.ts b/src/sprites/src/Shared/Sprite/Sprite.d.ts new file mode 100644 index 00000000000..1d3b30f8561 --- /dev/null +++ b/src/sprites/src/Shared/Sprite/Sprite.d.ts @@ -0,0 +1,18 @@ +export interface SpriteData { + Texture: string; + Size: Vector2; + Position: Vector2; + Name: string; +} + +interface Sprite { + Style(gui: T): T; + Get(gui: T): Instances[T]; +} + +interface SpriteConstructor { + readonly ClassName: 'Sprite'; + new (data: SpriteData): Sprite; +} + +export const Sprite: SpriteConstructor; diff --git a/src/sprites/src/Shared/Sprite/Spritesheet.d.ts b/src/sprites/src/Shared/Sprite/Spritesheet.d.ts new file mode 100644 index 00000000000..e35208b70ac --- /dev/null +++ b/src/sprites/src/Shared/Sprite/Spritesheet.d.ts @@ -0,0 +1,15 @@ +import { Sprite } from './Sprite'; + +interface Spritesheet { + GetPreloadAssetIds(): string; + AddSprite(keyCode: unknown, position: Vector2, size: Vector2): Sprite; + GetSprite(keyCode: unknown): Sprite | undefined; + HasSprite(keyCode: unknown): boolean; +} + +interface SpritesheetConstructor { + readonly ClassName: 'Spritesheet'; + new (texture: string): Spritesheet; +} + +export const Spritesheet: SpritesheetConstructor; diff --git a/src/statestack/index.d.ts b/src/statestack/index.d.ts new file mode 100644 index 00000000000..7d763c411c1 --- /dev/null +++ b/src/statestack/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/StateStack'; +export * from './src/Shared/RxStateStackUtils'; diff --git a/src/statestack/src/Shared/RxStateStackUtils.d.ts b/src/statestack/src/Shared/RxStateStackUtils.d.ts new file mode 100644 index 00000000000..6d46933c3a4 --- /dev/null +++ b/src/statestack/src/Shared/RxStateStackUtils.d.ts @@ -0,0 +1,10 @@ +import { Brio } from '../../../brio'; +import { Observable } from '../../../rx'; +import { StateStack } from './StateStack'; + +export namespace RxStateStackUtils { + function topOfStack( + defaultValue: T + ): (source: Observable>) => Observable; + function createStateStack(observable: Observable>): StateStack; +} diff --git a/src/statestack/src/Shared/StateStack.d.ts b/src/statestack/src/Shared/StateStack.d.ts new file mode 100644 index 00000000000..f957d309553 --- /dev/null +++ b/src/statestack/src/Shared/StateStack.d.ts @@ -0,0 +1,27 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +interface StateStack extends BaseObject { + GetCount(): number; + GetState(): T; + Observe(): Observable; + ObserveBrio(): Observable>; + ObserveBrio( + predicate?: (value: T) => value is NonNullable + ): Observable>>; + ObserveBrio( + predicate?: (value: T) => value is Exclude> + ): Observable>>>; + ObserveBrio(predicate?: (value: T) => boolean): Observable>; + PushState(value: T): () => void; + PushBrio(value: Brio): () => void; +} + +interface StateStackConstructor { + readonly ClassName: 'StateStack'; + new (): StateStack; + new (defaultValue: T, checkType?: string): StateStack; +} + +export const StateStack: StateStackConstructor; diff --git a/src/steputils/index.d.ts b/src/steputils/index.d.ts new file mode 100644 index 00000000000..3d3dd99878b --- /dev/null +++ b/src/steputils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/StepUtils'; +export * from './src/Shared/onRenderStepFrame'; +export * from './src/Shared/onSteppedFrame'; diff --git a/src/steputils/src/Shared/StepUtils.d.ts b/src/steputils/src/Shared/StepUtils.d.ts new file mode 100644 index 00000000000..849ed24d8bf --- /dev/null +++ b/src/steputils/src/Shared/StepUtils.d.ts @@ -0,0 +1,12 @@ +import { SignalLike } from '@quenty/signal'; + +export namespace StepUtils { + function bindToRenderStep(update: () => boolean): () => void; + function deferWait(): void; + function bindToStepped(update: () => boolean): () => void; + function bindToSignal(signal: SignalLike, update: () => boolean): () => void; + function onceAtRenderPriority(priority: number, func: () => void): () => void; + function onceAtStepped(func: () => void): () => void; + function onceAtRenderStepped(func: () => void): () => void; + function onceAtEvent(event: SignalLike, func: () => void): () => void; +} diff --git a/src/steputils/src/Shared/onRenderStepFrame.d.ts b/src/steputils/src/Shared/onRenderStepFrame.d.ts new file mode 100644 index 00000000000..6d2025a6bb6 --- /dev/null +++ b/src/steputils/src/Shared/onRenderStepFrame.d.ts @@ -0,0 +1,4 @@ +export const onRenderStepFrame: ( + priority: number, + callback: () => void +) => () => void; diff --git a/src/steputils/src/Shared/onSteppedFrame.d.ts b/src/steputils/src/Shared/onSteppedFrame.d.ts new file mode 100644 index 00000000000..ca8f6d895c9 --- /dev/null +++ b/src/steputils/src/Shared/onSteppedFrame.d.ts @@ -0,0 +1 @@ +export const onSteppedFrame: (func: () => void) => RBXScriptConnection; diff --git a/src/streamingutils/index.d.ts b/src/streamingutils/index.d.ts new file mode 100644 index 00000000000..64de8b3b0a6 --- /dev/null +++ b/src/streamingutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/StreamingUtils'; diff --git a/src/streamingutils/src/Shared/StreamingUtils.d.ts b/src/streamingutils/src/Shared/StreamingUtils.d.ts new file mode 100644 index 00000000000..3475484dfee --- /dev/null +++ b/src/streamingutils/src/Shared/StreamingUtils.d.ts @@ -0,0 +1,9 @@ +import { Promise } from '@quenty/promise'; + +export namespace StreamingUtils { + function promiseStreamAround( + player: Player, + position: Vector3, + timeOut?: number + ): Promise; +} diff --git a/src/string/index.d.ts b/src/string/index.d.ts new file mode 100644 index 00000000000..08d10cbbf81 --- /dev/null +++ b/src/string/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/String'; diff --git a/src/string/src/Shared/String.d.ts b/src/string/src/Shared/String.d.ts new file mode 100644 index 00000000000..713f4bc0732 --- /dev/null +++ b/src/string/src/Shared/String.d.ts @@ -0,0 +1,17 @@ +export namespace String { + function trim(str: string, pattern?: string): string; + function toCamelCase(str: string): string; + function uppercaseFirstLetter(str: string): string; + function toLowerCamelCase(str: string): string; + function toPrivateCase(str: string): string; + function trimFront(str: string, pattern?: string): string; + function checkNumOfCharacterInString(str: string, char: string): number; + function isEmptyOrWhitespaceOrNil(str: string | undefined): str is string; + function isWhitespace(str: string): boolean; + function elipseLimit(str: string, characterLimit: number): string; + function removePrefix(str: string, prefix: string): string; + function removePostFix(str: string, postfix: string): string; + function endsWith(str: string, postfix: string): boolean; + function startsWith(str: string, prefix: string): boolean; + function addCommas(number: string | number, seperator: string): string; +} diff --git a/src/sunpositionutils/index.d.ts b/src/sunpositionutils/index.d.ts new file mode 100644 index 00000000000..f098ff30174 --- /dev/null +++ b/src/sunpositionutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/SunPositionUtils'; diff --git a/src/sunpositionutils/src/Shared/SunPositionUtils.d.ts b/src/sunpositionutils/src/Shared/SunPositionUtils.d.ts new file mode 100644 index 00000000000..2bbd8500a9b --- /dev/null +++ b/src/sunpositionutils/src/Shared/SunPositionUtils.d.ts @@ -0,0 +1,15 @@ +export namespace SunPositionUtils { + function getGeographicalLatitudeFromDirection(direction: Vector3): number; + const getGeographicalLatitudeFromMoonDirection: typeof getGeographicalLatitudeFromDirection; + function getClockTimeFromDirection(direction: Vector3): number; + function getClockTimeFromMoonDirection(direction: Vector3): number; + function getDirection( + azimuthRad: number, + altitudeRad: number, + north: Vector3 + ): Vector3; + function getSunPosition( + clockTime: number, + geoLatitude: number + ): LuaTuple<[sunPosition: Vector3, moonPosition: Vector3]>; +} diff --git a/src/symbol/index.d.ts b/src/symbol/index.d.ts new file mode 100644 index 00000000000..21f3ba74499 --- /dev/null +++ b/src/symbol/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Symbol'; diff --git a/src/symbol/src/Shared/Symbol.d.ts b/src/symbol/src/Shared/Symbol.d.ts new file mode 100644 index 00000000000..2e5d644c27b --- /dev/null +++ b/src/symbol/src/Shared/Symbol.d.ts @@ -0,0 +1,8 @@ +interface Symbol {} + +interface SymbolConstructor { + named: (name: string) => Symbol; + isSymbol: (value: unknown) => value is Symbol; +} + +export const Symbol: SymbolConstructor; diff --git a/src/table/index.d.ts b/src/table/index.d.ts new file mode 100644 index 00000000000..9fdc5896f9d --- /dev/null +++ b/src/table/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/Set'; +export * from './src/Shared/Table'; diff --git a/src/table/src/Shared/Set.d.ts b/src/table/src/Shared/Set.d.ts new file mode 100644 index 00000000000..d09de847c1a --- /dev/null +++ b/src/table/src/Shared/Set.d.ts @@ -0,0 +1,42 @@ +type Set = T extends PropertyKey ? Record : Map; + +type GetSetType> = T extends Set ? A : never; + +export namespace Set { + function union, U extends Set>( + set: T, + otherSet: U + ): Set & GetSetType>; + function unionUpdate, U extends Set>( + set: T, + otherSet: U + ): Set & GetSetType>; + function intersection, U extends Set>( + set: T, + otherSet: U + ): Set & GetSetType>; + function copy>(set: T): T; + function count(set: Set): number; + function fromKeys< + T extends Map | Record + >( + tab: T + ): T extends Map + ? Set + : T extends Record + ? Set + : never; + function fromTableValue< + T extends Map | Record + >( + tab: T + ): T extends Map + ? Set + : T extends Record + ? Set + : never; + const fromList: typeof fromTableValue; + function toList(set: Set): T[]; + function differenceUpdate(set: Set, otherSet: Set): void; + function difference(set: Set, otherSet: Set): Set; +} diff --git a/src/table/src/Shared/Table.d.ts b/src/table/src/Shared/Table.d.ts new file mode 100644 index 00000000000..d7f88a71f3d --- /dev/null +++ b/src/table/src/Shared/Table.d.ts @@ -0,0 +1,65 @@ +type DictionaryLike = Record | Map; +type TableLike = DictionaryLike | unknown[]; + +type InvertDictionary> = { + [P in keyof T as T[P]]: P; +}; + +export namespace Table { + function append(target: T[], source: T[]): T[]; + function merge( + orig: T1, + other: T2 + ): T1 & T2; + function reverse(array: T[]): T[]; + function values( + source: T + ): T extends Map ? V[] : T[keyof T][]; + function keys( + source: T + ): T extends Map ? K[] : (keyof T)[]; + const mergeLists: typeof merge; + function swapKeyValue( + source: T + ): T extends Map + ? Map + : T extends Record + ? InvertDictionary + : never; + function toList( + source: T + ): T extends Map ? V[] : T[keyof T][]; + function count(table: DictionaryLike | unknown[]): number; + function copy(table: T): T; + function deepCopy( + table: T, + deepCopyContext?: TableLike + ): T; + function deepOverwrite( + target: T, + source: U + ): T & U; + function getIndex(haystack: T[], needle: T): number | undefined; + function stringify( + table: DictionaryLike | unknown[], + indent?: number, + output?: string + ): string; + function contains(table: T[], value: T): boolean; + function overwrite( + target: T, + source: U + ): T & U; + function deepEquivalent( + a: T, + b: U + ): boolean; + function take(array: T[], count: number): T[]; + function readonly( + table: T + ): Readonly; + function errorOnNilIndex(target: T): T; + function deepReadonly( + target: T + ): Readonly; +} diff --git a/src/teamtracker/index.d.ts b/src/teamtracker/index.d.ts new file mode 100644 index 00000000000..4c258c4ffbd --- /dev/null +++ b/src/teamtracker/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TeamTracker'; diff --git a/src/teamtracker/src/Shared/TeamTracker.d.ts b/src/teamtracker/src/Shared/TeamTracker.d.ts new file mode 100644 index 00000000000..490d418745d --- /dev/null +++ b/src/teamtracker/src/Shared/TeamTracker.d.ts @@ -0,0 +1,14 @@ +import { ValueObject } from '@quenty/valueobject'; + +interface TeamTracker { + CurrentTeam: ValueObject; + GetPlayer(): Player; + Destroy(): void; +} + +interface TeamTrackerConstructor { + readonly ClassName: 'TeamTracker'; + new (player: Player): TeamTracker; +} + +export const TeamTracker: TeamTrackerConstructor; diff --git a/src/teamutils/index.d.ts b/src/teamutils/index.d.ts new file mode 100644 index 00000000000..c2a76c4d092 --- /dev/null +++ b/src/teamutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxTeamUtils'; +export * from './src/Shared/TeamUtils'; diff --git a/src/teamutils/src/Shared/RxTeamUtils.d.ts b/src/teamutils/src/Shared/RxTeamUtils.d.ts new file mode 100644 index 00000000000..c1655092d34 --- /dev/null +++ b/src/teamutils/src/Shared/RxTeamUtils.d.ts @@ -0,0 +1,20 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxTeamUtils { + function observePlayerTeam(player: Player): Observable; + function observePlayerTeamColor( + player: Player + ): Observable; + function observePayersForTeamBrio(team: Team): Observable>; + function observeEnemyTeamColorPlayersBrio( + teamColor: BrickColor + ): Observable>; + function observePlayersForTeamColorBrio( + teamColor: BrickColor + ): Observable>; + function observeTeamsForColorBrio( + teamColor: BrickColor + ): Observable>; + function observeTeamsBrio(): Observable>; +} diff --git a/src/teamutils/src/Shared/TeamUtils.d.ts b/src/teamutils/src/Shared/TeamUtils.d.ts new file mode 100644 index 00000000000..4d7d9c91f36 --- /dev/null +++ b/src/teamutils/src/Shared/TeamUtils.d.ts @@ -0,0 +1,4 @@ +export namespace TeamUtils { + function areTeamMates(playerA: Player, playerB: Player): boolean; + function getTeam(player: Player): Team | undefined; +} diff --git a/src/teleportserviceutils/index.d.ts b/src/teleportserviceutils/index.d.ts new file mode 100644 index 00000000000..6ac2c8e94d7 --- /dev/null +++ b/src/teleportserviceutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Server/RxTeleportUtils'; +export * from './src/Server/TeleportServiceUtils'; diff --git a/src/teleportserviceutils/src/Server/RxTeleportUtils.d.ts b/src/teleportserviceutils/src/Server/RxTeleportUtils.d.ts new file mode 100644 index 00000000000..c5255dacf72 --- /dev/null +++ b/src/teleportserviceutils/src/Server/RxTeleportUtils.d.ts @@ -0,0 +1,6 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxTeleportUtils { + function observeTeleportBrio(player: Player): Observable>; +} diff --git a/src/teleportserviceutils/src/Server/TeleportServiceUtils.d.ts b/src/teleportserviceutils/src/Server/TeleportServiceUtils.d.ts new file mode 100644 index 00000000000..099a6a36e51 --- /dev/null +++ b/src/teleportserviceutils/src/Server/TeleportServiceUtils.d.ts @@ -0,0 +1,10 @@ +import { Promise } from '@quenty/promise'; + +export namespace TeleportServiceUtils { + function promiseReserveServer(placeId: number): Promise; + function promiseTeleport( + placeId: number, + players: Player[], + teleportOptions?: TeleportOptions + ): Promise; +} diff --git a/src/templateprovider/index.d.ts b/src/templateprovider/index.d.ts new file mode 100644 index 00000000000..4bb03556ee2 --- /dev/null +++ b/src/templateprovider/index.d.ts @@ -0,0 +1,6 @@ +export * from './src/Shared/TemplateProvider'; +export * from './src/Shared/TaggedTemplateProvider'; +export * from './src/Shared/Replication/Util/TemplateReplicationModes'; +export * from './src/Shared/Replication/Util/TemplateReplicationModesUtils'; +export * from './src/Shared/Modules/ModuleProvider'; +export * from './src/Shared/Modules/ModuleProviderFakeLoader'; diff --git a/src/templateprovider/src/Shared/Modules/ModuleProvider.d.ts b/src/templateprovider/src/Shared/Modules/ModuleProvider.d.ts new file mode 100644 index 00000000000..7260e83ca31 --- /dev/null +++ b/src/templateprovider/src/Shared/Modules/ModuleProvider.d.ts @@ -0,0 +1,18 @@ +interface ModuleProvider { + Init(): void; + GetModules(): unknown[]; + GetFromName(name: string): unknown; +} + +interface ModuleProviderConstructor { + readonly ClassName: 'ModuleProvider'; + readonly ServiceName: 'ModuleProvider'; + new ( + parent: Instance, + checkModule?: (_module: unknown, moduleScript: ModuleScript) => void, + initModule?: (_module: unknown, moduleScript: ModuleScript) => void, + sortList?: (list: unknown[]) => void + ): ModuleProvider; +} + +export const ModuleProvider: ModuleProviderConstructor; diff --git a/src/templateprovider/src/Shared/Modules/ModuleProviderFakeLoader.d.ts b/src/templateprovider/src/Shared/Modules/ModuleProviderFakeLoader.d.ts new file mode 100644 index 00000000000..6b8c2be0971 --- /dev/null +++ b/src/templateprovider/src/Shared/Modules/ModuleProviderFakeLoader.d.ts @@ -0,0 +1,3 @@ +export namespace ModuleProviderFakeLoader { + function load(script: LuaSourceContainer): unknown; +} diff --git a/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModes.d.ts b/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModes.d.ts new file mode 100644 index 00000000000..92e4bfc8232 --- /dev/null +++ b/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModes.d.ts @@ -0,0 +1,7 @@ +export const TemplateReplicationModes: Readonly<{ + CLIENT: 'client'; + SHARED: 'shared'; + SERVER: 'server'; +}>; + +export type TemplateReplicationMode = 'client' | 'server' | 'shared'; diff --git a/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModesUtils.d.ts b/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModesUtils.d.ts new file mode 100644 index 00000000000..c7ea78e0958 --- /dev/null +++ b/src/templateprovider/src/Shared/Replication/Util/TemplateReplicationModesUtils.d.ts @@ -0,0 +1,5 @@ +import { TemplateReplicationMode } from './TemplateReplicationModes'; + +export namespace TemplateReplicationModesUtils { + function inferReplicationMode(): TemplateReplicationMode; +} diff --git a/src/templateprovider/src/Shared/TaggedTemplateProvider.d.ts b/src/templateprovider/src/Shared/TaggedTemplateProvider.d.ts new file mode 100644 index 00000000000..f5a6c530633 --- /dev/null +++ b/src/templateprovider/src/Shared/TaggedTemplateProvider.d.ts @@ -0,0 +1,8 @@ +import { TemplateProvider } from './TemplateProvider'; + +interface TaggedTemplateProviderConstructor { + readonly ClassName: 'TaggedTemplateProvider'; + new (providerName: string, tagName: string): TemplateProvider; +} + +export const TaggedTemplateProvider: TaggedTemplateProviderConstructor; diff --git a/src/templateprovider/src/Shared/TemplateProvider.d.ts b/src/templateprovider/src/Shared/TemplateProvider.d.ts new file mode 100644 index 00000000000..7facb6050c3 --- /dev/null +++ b/src/templateprovider/src/Shared/TemplateProvider.d.ts @@ -0,0 +1,37 @@ +import { Brio } from '@quenty/brio'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export type TemplateDeclaration = + | Instance + | Observable> + | TemplateDeclaration[]; + +interface TemplateProvider { + Init(serviceBag: ServiceBag): void; + ObserveTemplate(templateName: string): Observable; + ObserveTemplateNamesBrio(): Observable>; + GetTemplate(templateName: string): Instance | undefined; + PromiseCloneTemplate(templateName: string): Promise; + PromiseTemplate(templateName: string): Promise; + CloneTemplate(templateName: string): Instance | undefined; + AddTemplates(container: TemplateDeclaration): () => void; + IsTemplateAvailable(templateName: string): boolean; + GetTemplateList(): Instance[]; + GetContainerList(): Instance[]; + Destroy(): void; +} + +interface TemplateProviderConstructor { + readonly ClassName: 'TemplateProvider'; + readonly ServiceName: 'TemplateProvider'; + new ( + providerName: string, + initialTemplate: TemplateDeclaration + ): TemplateProvider; + + isTemplateProvider: (value: unknown) => value is TemplateProvider; +} + +export const TemplateProvider: TemplateProviderConstructor; diff --git a/src/terrainutils/index.d.ts b/src/terrainutils/index.d.ts new file mode 100644 index 00000000000..3c9779d726c --- /dev/null +++ b/src/terrainutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TerrainUtils'; diff --git a/src/terrainutils/src/Shared/TerrainUtils.d.ts b/src/terrainutils/src/Shared/TerrainUtils.d.ts new file mode 100644 index 00000000000..442f5640af8 --- /dev/null +++ b/src/terrainutils/src/Shared/TerrainUtils.d.ts @@ -0,0 +1,13 @@ +export namespace TerrainUtils { + function getTerrainRegion3( + position: Vector3, + size: Vector3, + resolution: number + ): Region3; + function getTerrainRegion3int16FromRegion3( + region3: Region3, + resolution: number + ): Region3int16; + function getCorner(region3: Region3): Vector3; + function getCornerint16(region3: Region3, resolution: number): Vector3int16; +} diff --git a/src/textboxutils/index.d.ts b/src/textboxutils/index.d.ts new file mode 100644 index 00000000000..a7aaf6a75f7 --- /dev/null +++ b/src/textboxutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/RxTextBoxUtils'; diff --git a/src/textboxutils/src/Shared/RxTextBoxUtils.d.ts b/src/textboxutils/src/Shared/RxTextBoxUtils.d.ts new file mode 100644 index 00000000000..9529cd0e6b1 --- /dev/null +++ b/src/textboxutils/src/Shared/RxTextBoxUtils.d.ts @@ -0,0 +1,5 @@ +import { Observable } from '@quenty/rx'; + +export namespace RxTextBoxUtils { + function observeIsFocused(textBox: TextBox): Observable; +} diff --git a/src/textfilterservice/index.d.ts b/src/textfilterservice/index.d.ts new file mode 100644 index 00000000000..ac3fb852a4d --- /dev/null +++ b/src/textfilterservice/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Client/TextFilterServiceClient'; +export * from './src/Server/TextFilterService'; +export * from './src/Shared/TextFilterServiceConstants'; diff --git a/src/textfilterservice/src/Client/TextFilterServiceClient.d.ts b/src/textfilterservice/src/Client/TextFilterServiceClient.d.ts new file mode 100644 index 00000000000..fc0e9b1ef9e --- /dev/null +++ b/src/textfilterservice/src/Client/TextFilterServiceClient.d.ts @@ -0,0 +1,16 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +export interface TextFilterServiceClient { + readonly ServiceName: 'TextFilterServiceClient'; + PromiseNonChatStringForUser( + text: string, + fromUserId: number + ): Promise; + PromiseNonChatStringForBroadcast( + text: string, + fromUserId: number + ): Promise; + PromisePreviewNonChatStringForBroadcast(text: string): Promise; + ObservePreviewNonChatStringForBroadcast(text: string): Observable; +} diff --git a/src/textfilterservice/src/Server/TextFilterService.d.ts b/src/textfilterservice/src/Server/TextFilterService.d.ts new file mode 100644 index 00000000000..4860018712a --- /dev/null +++ b/src/textfilterservice/src/Server/TextFilterService.d.ts @@ -0,0 +1,4 @@ +export interface TextFilterService { + readonly ServiceName: 'TextFilterService'; + Init(): void; +} diff --git a/src/textfilterservice/src/Shared/TextFilterServiceConstants.d.ts b/src/textfilterservice/src/Shared/TextFilterServiceConstants.d.ts new file mode 100644 index 00000000000..0102bd9c0a0 --- /dev/null +++ b/src/textfilterservice/src/Shared/TextFilterServiceConstants.d.ts @@ -0,0 +1,7 @@ +export const TextFilterServiceConstants: Readonly<{ + REMOTE_FUNCTION_NAME: 'TextFilterServiceRemoteFunction'; + + REQUEST_NON_CHAT_STRING_FOR_USER: 'NonChatStringForUser'; + REQUEST_NON_CHAT_STRING_FOR_BROADCAST: 'NonChatStringForBroadcast'; + REQUEST_PREVIEW_NON_CHAT_STRING_FOR_BROADCAST: 'PreviewNonChatStringForBroadcast'; +}>; diff --git a/src/textfilterutils/index.d.ts b/src/textfilterutils/index.d.ts new file mode 100644 index 00000000000..d5649a59440 --- /dev/null +++ b/src/textfilterutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TextFilterUtils'; diff --git a/src/textfilterutils/src/Shared/TextFilterUtils.d.ts b/src/textfilterutils/src/Shared/TextFilterUtils.d.ts new file mode 100644 index 00000000000..8e3e9e951c7 --- /dev/null +++ b/src/textfilterutils/src/Shared/TextFilterUtils.d.ts @@ -0,0 +1,39 @@ +import { Promise } from '@quenty/promise'; + +export namespace TextFilterUtils { + function promiseNonChatStringForBroadcast( + text: string, + fromUserId: number, + textFilterContent: Enum.TextFilterContext + ): Promise; + function promiseLegacyChatFilter( + playerFrom: Player, + text: string + ): Promise; + function promiseNonChatStringForUserAsync( + text: string, + fromUserId: number, + toUserId: number, + textFilterContext: Enum.TextFilterContext + ): Promise; + function getNonChatStringForBroadcastAsync( + text: string, + fromUserId: number, + textFilterContent: Enum.TextFilterContext + ): LuaTuple<[result: string, err?: string]>; + function getNonChatStringForUserAsync( + text: string, + fromUserId: number, + toUserId: number, + textFilterContext: Enum.TextFilterContext + ): LuaTuple<[result: string, err?: string]>; + function hasNonFilteredText(text: string): boolean; + function getProportionFiltered(text: string): number; + function countFilteredCharacters( + text: string + ): LuaTuple<[filtered: number, unfiltered: number, whitespace: number]>; + function addBackInNewLinesAndWhitespace( + text: string, + filteredText: string + ): string; +} diff --git a/src/textserviceutils/index.d.ts b/src/textserviceutils/index.d.ts new file mode 100644 index 00000000000..038da60a3cd --- /dev/null +++ b/src/textserviceutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TextServiceUtils'; diff --git a/src/textserviceutils/src/Shared/TextServiceUtils.d.ts b/src/textserviceutils/src/Shared/TextServiceUtils.d.ts new file mode 100644 index 00000000000..80b06398567 --- /dev/null +++ b/src/textserviceutils/src/Shared/TextServiceUtils.d.ts @@ -0,0 +1,30 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +export namespace TextServiceUtils { + function getSizeForLabel( + textLabel: TextLabel, + text: string, + maxWidth?: number + ): Vector2; + function promiseTextBounds(params: GetTextBoundsParams): Promise; + function observeSizeForLabelProps( + props: { + Text: string | ValueBase; + TextSize: number; + MaxSize?: Vector2; + LineHeight?: number; + } & ( + | { + Font: Enum.Font; + } + | { + FontFace: Font; + } + | { + Font: Enum.Font; + FontFace: Font; + } + ) + ): Observable; +} diff --git a/src/throttle/index.d.ts b/src/throttle/index.d.ts new file mode 100644 index 00000000000..00644edc94c --- /dev/null +++ b/src/throttle/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/ThrottledFunction'; +export * from './src/Shared/throttle'; diff --git a/src/throttle/src/Shared/ThrottledFunction.d.ts b/src/throttle/src/Shared/ThrottledFunction.d.ts new file mode 100644 index 00000000000..b41c670093a --- /dev/null +++ b/src/throttle/src/Shared/ThrottledFunction.d.ts @@ -0,0 +1,21 @@ +interface ThrottledFunction { + Call(...args: Args extends unknown[] ? Args : [Args]): void; + Destroy(): void; +} + +interface ThrottleConfig { + leading?: boolean; + trailing?: boolean; + leadingFirstTimeOnly?: boolean; +} + +interface ThrottledFunctionConstructor { + readonly ClassName: 'ThrottledFunction'; + new ( + timeoutInSeconds: number, + func: (...args: Args extends unknown[] ? Args : [Args]) => void, + config?: ThrottleConfig + ): ThrottledFunction; +} + +export const ThrottledFunction: ThrottledFunctionConstructor; diff --git a/src/throttle/src/Shared/throttle.d.ts b/src/throttle/src/Shared/throttle.d.ts new file mode 100644 index 00000000000..ce97972221e --- /dev/null +++ b/src/throttle/src/Shared/throttle.d.ts @@ -0,0 +1,10 @@ +import { ThrottleConfig } from './ThrottledFunction'; + +export const throttle: < + Args, + TupleArgs extends Args extends unknown[] ? Args : [Args] +>( + timeoutInSeconds: number, + func: (...args: TupleArgs) => void, + throttleConfig?: ThrottleConfig +) => (...args: TupleArgs) => void; diff --git a/src/tie/index.d.ts b/src/tie/index.d.ts new file mode 100644 index 00000000000..a84c46d8754 --- /dev/null +++ b/src/tie/index.d.ts @@ -0,0 +1,8 @@ +export * from './src/Shared/Members/Methods/TieMethodDefinition'; +export * from './src/Shared/Members/TieMemberDefinition'; +export * from './src/Shared/Realms/TieRealmUtils'; +export * from './src/Shared/Realms/TieRealms'; +export * from './src/Shared/Services/TieRealmService'; +export * from './src/Shared/TieDefinition'; +export * from './src/Shared/TieImplementation'; +export * from './src/Shared/TieInterface'; diff --git a/src/tie/src/Shared/Members/Methods/TieMethodDefinition.d.ts b/src/tie/src/Shared/Members/Methods/TieMethodDefinition.d.ts new file mode 100644 index 00000000000..9b649037174 --- /dev/null +++ b/src/tie/src/Shared/Members/Methods/TieMethodDefinition.d.ts @@ -0,0 +1,16 @@ +import { TieRealm } from '../../Realms/TieRealms'; +import { TieDefinition } from '../../TieDefinition'; +import { TieMemberDefinition } from '../TieMemberDefinition'; + +interface TieMethodDefinition extends TieMemberDefinition {} + +interface TieMethodDefinitionConstructor { + readonly ClassName: 'TieMethodDefinition'; + new ( + tieDefinition: TieDefinition, + methodName: string, + memberTieRealm: TieRealm + ): TieMethodDefinition; +} + +export const TieMethodDefinition: TieMethodDefinitionConstructor; diff --git a/src/tie/src/Shared/Members/TieMemberDefinition.d.ts b/src/tie/src/Shared/Members/TieMemberDefinition.d.ts new file mode 100644 index 00000000000..87860a498f5 --- /dev/null +++ b/src/tie/src/Shared/Members/TieMemberDefinition.d.ts @@ -0,0 +1,36 @@ +import { BaseObject } from '@quenty/baseobject'; +import { TieRealm } from '../Realms/TieRealms'; +import { TieDefinition } from '../TieDefinition'; + +interface TieMemberDefinition extends BaseObject { + Implement( + implParent: Instance, + initialValue: (actualSelf: T, ...args: unknown[]) => unknown, + actualSelf: T, + tieRealm: TieRealm + ): void; + GetInterface( + implParent: Instance, + aliasSelf: unknown, + tieRealm: TieRealm + ): void; + GetFriendlyName(): string; + IsRequiredForInterface(currentRealm: TieRealm): boolean; + IsAllowedOnInterface(currentRealm: TieRealm): boolean; + IsRequiredForImplementation(currentRealm: TieRealm): boolean; + IsAllowedForImplementation(currentRealm: TieRealm): boolean; + GetMemberTieRealm(): TieRealm; + GetTieDefinition(): TieDefinition; + GetMemberName(): string; +} + +interface TieMemberDefinitionConstructor { + readonly ClassName: 'TieMemberDefinition'; + new ( + tieDefinition: TieDefinition, + memberName: string, + memberTieRealm: TieRealm + ): TieMemberDefinition; +} + +export const TieMemberDefinition: TieMemberDefinitionConstructor; diff --git a/src/tie/src/Shared/Realms/TieRealmUtils.d.ts b/src/tie/src/Shared/Realms/TieRealmUtils.d.ts new file mode 100644 index 00000000000..d06eb6f1c59 --- /dev/null +++ b/src/tie/src/Shared/Realms/TieRealmUtils.d.ts @@ -0,0 +1,6 @@ +import { TieRealm } from './TieRealms'; + +export namespace TieRealmUtils { + function isTieRealm(value: unknown): value is TieRealm; + function inferTieRealm(): 'client' | 'server'; +} diff --git a/src/tie/src/Shared/Realms/TieRealms.d.ts b/src/tie/src/Shared/Realms/TieRealms.d.ts new file mode 100644 index 00000000000..e6a55817d5b --- /dev/null +++ b/src/tie/src/Shared/Realms/TieRealms.d.ts @@ -0,0 +1,7 @@ +export type TieRealm = 'shared' | 'client' | 'server'; + +export const TieRealms: Readonly<{ + SHARED: 'shared'; + CLIENT: 'client'; + SERVER: 'server'; +}>; diff --git a/src/tie/src/Shared/Services/TieRealmService.d.ts b/src/tie/src/Shared/Services/TieRealmService.d.ts new file mode 100644 index 00000000000..97b3088d436 --- /dev/null +++ b/src/tie/src/Shared/Services/TieRealmService.d.ts @@ -0,0 +1,9 @@ +import { ServiceBag } from '@quenty/servicebag'; +import { TieRealm } from '../Realms/TieRealms'; + +export interface TieRealmService { + readonly ServiceName: 'TieRealmService'; + Init(serviceBag: ServiceBag): void; + SetTieRealm(tieRealm: TieRealm): void; + GetTieRealm(): TieRealm; +} diff --git a/src/tie/src/Shared/TieDefinition.d.ts b/src/tie/src/Shared/TieDefinition.d.ts new file mode 100644 index 00000000000..5a80b62539a --- /dev/null +++ b/src/tie/src/Shared/TieDefinition.d.ts @@ -0,0 +1,103 @@ +import { Symbol } from '@quenty/symbol'; +import { TieRealm, TieRealms } from './Realms/TieRealms'; +import { Observable } from '@quenty/rx'; +import { Brio } from '@quenty/brio'; +import { Promise } from '@quenty/promise'; +import { TieInterface } from './TieInterface'; +import { TieImplementation } from './TieImplementation'; +import { TieMemberDefinition } from './Members/TieMemberDefinition'; + +export type TieDefinitionMethod = Symbol; +export type TieDefinitionSignal = Symbol; +export type TieDefinitionProperty = Symbol; + +interface TieDefinition | unknown> { + Types: Readonly<{ + METHOD: TieDefinitionMethod; + SIGNAL: TieDefinitionSignal; + PROPERTY: TieDefinitionProperty; + }>; + Realms: typeof TieRealms; + + GetImplementations(adornee: Instance, tieRealm?: TieRealm): TieInterface[]; + GetNewImplClass(tieRealm: TieRealm): 'Configuration' | 'Camera'; + GetImplClassSet(tieRealm: TieRealm): Readonly< + | { + Configuration: true; + } + | { + Camera: true; + } + | { + Configuration: true; + Camera: true; + } + >; + GetImplementationParents(adornee: Instance, tieRealm?: TieRealm): Instance[]; + ObserveChildrenBrio( + adornee: Instance, + tieRealm?: TieRealm + ): Observable>; + Promise(adornee: Instance, tieRealm?: TieRealm): Promise; + GetChildren(adornee: Instance, tieRealm?: TieRealm): TieInterface[]; + Find(adornee: Instance, tieRealm?: TieRealm): TieInterface | undefined; + ObserveAllTaggedBrio( + tagName: string, + tieRealm?: TieRealm + ): Observable>; + FindFirstImplementation( + adornee: Instance, + tieRealm?: TieRealm + ): TieInterface | undefined; + HasImplementation(adornee: Instance, tieRealm?: TieRealm): boolean; + ObserveIsImplemented( + adornee: Instance, + tieRealm?: TieRealm + ): Observable; + ObserveIsImplementation( + implParent: Instance, + tieRealm?: TieRealm + ): Observable; + ObserveIsImplementedOn( + implParent: Instance, + adornee: Instance, + tieRealm?: TieRealm + ): Observable; + ObserveBrio( + adornee: Instance, + tieRealm?: TieRealm + ): Observable>; + Observe( + adornee: Instance, + tieRealm?: TieRealm + ): Observable; + ObserveImplementationsBrio( + adornee: Instance, + tieRealm?: TieRealm + ): Observable>; + ObserveValidContainerChildrenBrio( + adornee: Instance, + tieRealm?: TieRealm + ): Observable>; + Implement( + adornee: Instance, + implementer?: TieInterface, + tieRealm?: TieRealm + ): TieImplementation; + Get(adornee: Instance, tieRealm?: TieRealm): TieInterface; + GetName(): string; + GetValidContainerNameSet(tieRealm?: TieRealm): Readonly>; + GetNewContainerName(tieRealm?: TieRealm): string; + GetMemberMap(): Readonly>; + IsImplementation(implParent: Instance, tieRealm?: TieRealm): boolean; +} + +interface TieDefinitionConstructor { + readonly ClassName: 'TieDefinition'; + new >( + definitionName: string, + members: T + ): TieDefinition; +} + +export const TieDefinition: TieDefinitionConstructor; diff --git a/src/tie/src/Shared/TieImplementation.d.ts b/src/tie/src/Shared/TieImplementation.d.ts new file mode 100644 index 00000000000..8521624f4bf --- /dev/null +++ b/src/tie/src/Shared/TieImplementation.d.ts @@ -0,0 +1,21 @@ +import { TieRealm } from './Realms/TieRealms'; +import { TieDefinition } from './TieDefinition'; +import { TieInterface } from './TieInterface'; +import { BaseObject } from '@quenty/baseobject'; + +interface TieImplementation extends BaseObject { + GetImplementationTieRealm(): TieRealm; + GetImplParent(): Instance; +} + +interface TieImplementationConstructor { + readonly ClassName: 'TieImplementation'; + new ( + tieDefinition: TieDefinition, + adornee: Instance, + implementer: TieInterface, + implementationTieRealms: TieRealm + ): TieImplementation; +} + +export const TieImplementation: TieImplementationConstructor; diff --git a/src/tie/src/Shared/TieInterface.d.ts b/src/tie/src/Shared/TieInterface.d.ts new file mode 100644 index 00000000000..27316d1744c --- /dev/null +++ b/src/tie/src/Shared/TieInterface.d.ts @@ -0,0 +1,21 @@ +import { Observable } from '@quenty/rx'; +import { TieRealm } from './Realms/TieRealms'; +import { TieDefinition } from './TieDefinition'; + +interface TieInterface { + IsImplemented(): boolean; + GetTieAdornee(): Instance | undefined; + ObserveIsImplemented(): Observable; +} + +interface TieInterfaceConstructor { + readonly ClassName: 'TieInterface'; + new ( + definition: TieDefinition, + implParent: Instance | undefined, + adornee: Instance | undefined, + interfaceTieRealm: TieRealm + ): TieInterface; +} + +export const TieInterface: TieInterfaceConstructor; diff --git a/src/time/index.d.ts b/src/time/index.d.ts new file mode 100644 index 00000000000..e2443931760 --- /dev/null +++ b/src/time/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Time'; diff --git a/src/time/src/Shared/Time.d.ts b/src/time/src/Shared/Time.d.ts new file mode 100644 index 00000000000..f94ff297916 --- /dev/null +++ b/src/time/src/Shared/Time.d.ts @@ -0,0 +1,35 @@ +export namespace Time { + function getDaysMonthTable(year: number): { + [month: number]: number; + }; + function getSecond(currentTime: number): number; + function getMinute(currentTime: number): number; + function getHour(currentTime: number): number; + function getDay(currentTime: number): number; + function getYear(currentTime: number): number; + function getYearShort(currentTime: number): number; + function getYearShortFormatted(currentTime: number): string; + function getMonth(currentTime: number): number | undefined; + function getFormattedMonth(currentTime: number): string; + function getDayOfTheMonth(currentTime: number): number | undefined; + function getFormattedDayOfTheMonth(currentTime: number): string; + function getMonthName(currentTime: number): string; + function getMonthNameShort(currentTime: number): string; + function getJulianDate(currentTime: number): number; + function getDayOfTheWeek(currentTime: number): number; + function getDayOfTheWeekName(currentTime: number): string; + function getDayOfTheWeekNameShort(currentTime: number): string; + function getOrdinalOfNumber(number: number): string; + function getDayOfTheMonthOrdinal(currentTime: number): string | undefined; + function getFormattedSecond(currentTime: number): string; + function getFormattedMinute(currentTime: number): string; + function getRegularHour(currentTime: number): number; + function getHourFormatted(currentTime: number): string; + function getRegularHourFormatted(currentTime: number): string; + function getamOrpm(currentTime: number): 'am' | 'pm'; + function getAMorPM(currentTime: number): 'AM' | 'PM'; + function getMilitaryHour(currentTime: number): string; + function isLeapYear(currentTime: number): boolean; + function getDaysInMonth(currentTime: number): number; + function getFormattedTime(format: string, currentTime: number): string; +} diff --git a/src/timedtween/index.d.ts b/src/timedtween/index.d.ts new file mode 100644 index 00000000000..8a33162ea9c --- /dev/null +++ b/src/timedtween/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TimedTween'; diff --git a/src/timedtween/src/Shared/TimedTween.d.ts b/src/timedtween/src/Shared/TimedTween.d.ts new file mode 100644 index 00000000000..3f9fa409f9d --- /dev/null +++ b/src/timedtween/src/Shared/TimedTween.d.ts @@ -0,0 +1,21 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +interface TimedTween extends BasicPane { + SetTransitionTime(transitionTime: number | Observable): void; + GetTransitionTime(): number; + ObserveTransitionTime(): Observable; + ObserveRenderStepped(): Observable; + ObserveOnSignal(signal: Signal): Observable; + Observe(): Observable; + PromiseFinished(): Promise; +} + +interface TimedTweenConstructor { + readonly ClassName: 'TimedTween'; + new (transitionTime?: number): TimedTween; +} + +export const TimedTween: TimedTweenConstructor; diff --git a/src/timesyncservice/index.d.ts b/src/timesyncservice/index.d.ts new file mode 100644 index 00000000000..d769d025fb0 --- /dev/null +++ b/src/timesyncservice/index.d.ts @@ -0,0 +1,6 @@ +export * from './src/Shared/Clocks/BaseClock'; +export * from './src/Shared/Clocks/MasterClock'; +export * from './src/Shared/Clocks/SlaveClock'; +export * from './src/Shared/TimeSyncConstants'; +export * from './src/Shared/TimeSyncService'; +export * from './src/Shared/TimeSyncUtils'; diff --git a/src/timesyncservice/src/Shared/Clocks/BaseClock.d.ts b/src/timesyncservice/src/Shared/Clocks/BaseClock.d.ts new file mode 100644 index 00000000000..6ba7cafbedd --- /dev/null +++ b/src/timesyncservice/src/Shared/Clocks/BaseClock.d.ts @@ -0,0 +1,13 @@ +import { Observable } from '@quenty/rx'; + +export type ClockFunction = () => number; + +export interface BaseClock { + GetTime(): number; + GetPing(): number; + IsSynced(): boolean; + ObservePing(): Observable; + GetClockFunction(): ClockFunction; +} + +export const BaseClock: {}; diff --git a/src/timesyncservice/src/Shared/Clocks/MasterClock.d.ts b/src/timesyncservice/src/Shared/Clocks/MasterClock.d.ts new file mode 100644 index 00000000000..b3c9a22ee28 --- /dev/null +++ b/src/timesyncservice/src/Shared/Clocks/MasterClock.d.ts @@ -0,0 +1,11 @@ +import { BaseObject } from '@quenty/baseobject'; +import { BaseClock } from './BaseClock'; + +interface MasterClock extends BaseObject, BaseClock {} + +interface MasterClockConstructor { + readonly ClassName: 'MasterClock'; + new (remoteEvent: RemoteEvent, remoteFunction: RemoteFunction): MasterClock; +} + +export const MasterClock: MasterClockConstructor; diff --git a/src/timesyncservice/src/Shared/Clocks/SlaveClock.d.ts b/src/timesyncservice/src/Shared/Clocks/SlaveClock.d.ts new file mode 100644 index 00000000000..d7d1b5a52bf --- /dev/null +++ b/src/timesyncservice/src/Shared/Clocks/SlaveClock.d.ts @@ -0,0 +1,13 @@ +import { BaseObject } from '@quenty/baseobject'; +import { BaseClock } from './BaseClock'; + +interface SlaveClock extends BaseObject, BaseClock { + TickToSyncedTime(syncedTime: number): number; +} + +interface SlaveClockConstructor { + readonly ClassName: 'SlaveClock'; + new (remoteEvent: RemoteEvent, remoteFunction: RemoteFunction): SlaveClock; +} + +export const SlaveClock: SlaveClockConstructor; diff --git a/src/timesyncservice/src/Shared/TimeSyncConstants.d.ts b/src/timesyncservice/src/Shared/TimeSyncConstants.d.ts new file mode 100644 index 00000000000..7f9bf9f3854 --- /dev/null +++ b/src/timesyncservice/src/Shared/TimeSyncConstants.d.ts @@ -0,0 +1,4 @@ +export const TimeSyncConstants: Readonly<{ + REMOTE_EVENT_NAME: 'TimeSyncServiceRemoteEvent'; + REMOTE_FUNCTION_NAME: 'TimeSyncServiceRemoteFunction'; +}>; diff --git a/src/timesyncservice/src/Shared/TimeSyncService.d.ts b/src/timesyncservice/src/Shared/TimeSyncService.d.ts new file mode 100644 index 00000000000..7d2e5f948d7 --- /dev/null +++ b/src/timesyncservice/src/Shared/TimeSyncService.d.ts @@ -0,0 +1,13 @@ +import { Observable } from '@quenty/rx'; +import { BaseClock } from './Clocks/BaseClock'; + +export interface TimeSyncService { + readonly ServiceName: 'TimeSyncService'; + Init(): void; + IsSynced(): boolean; + WaitForSyncedClock(): BaseClock; + GetSyncedClock(): BaseClock | undefined; + PromiseSyncedClock(): Promise; + ObserveSyncedClock(): Observable; + Destroy(): void; +} diff --git a/src/timesyncservice/src/Shared/TimeSyncUtils.d.ts b/src/timesyncservice/src/Shared/TimeSyncUtils.d.ts new file mode 100644 index 00000000000..03fe87807f9 --- /dev/null +++ b/src/timesyncservice/src/Shared/TimeSyncUtils.d.ts @@ -0,0 +1,9 @@ +import { Promise } from '@quenty/promise'; +import { SlaveClock } from './Clocks/SlaveClock'; +import { MasterClock } from './Clocks/MasterClock'; + +export namespace TimeSyncUtils { + function promiseClockSynced( + clock: MasterClock | SlaveClock + ): Promise; +} diff --git a/src/toolutils/index.d.ts b/src/toolutils/index.d.ts new file mode 100644 index 00000000000..6ef9a41adca --- /dev/null +++ b/src/toolutils/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/RxToolUtils'; +export * from './src/Shared/ToolUtils'; diff --git a/src/toolutils/src/Shared/RxToolUtils.d.ts b/src/toolutils/src/Shared/RxToolUtils.d.ts new file mode 100644 index 00000000000..7877adc2afc --- /dev/null +++ b/src/toolutils/src/Shared/RxToolUtils.d.ts @@ -0,0 +1,6 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace RxToolUtils { + function observeEquippedHumanoidBro(tool: Tool): Observable>; +} diff --git a/src/toolutils/src/Shared/ToolUtils.d.ts b/src/toolutils/src/Shared/ToolUtils.d.ts new file mode 100644 index 00000000000..7879ca57c8c --- /dev/null +++ b/src/toolutils/src/Shared/ToolUtils.d.ts @@ -0,0 +1,4 @@ +export namespace ToolUtils { + function getEquippedHumanoid(tool: Tool): Humanoid | undefined; + function getEquippedPlayer(tool: Tool): Player | undefined; +} diff --git a/src/touchingpartutils/index.d.ts b/src/touchingpartutils/index.d.ts new file mode 100644 index 00000000000..9b420823216 --- /dev/null +++ b/src/touchingpartutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TouchingPartUtils'; diff --git a/src/touchingpartutils/src/Shared/TouchingPartUtils.d.ts b/src/touchingpartutils/src/Shared/TouchingPartUtils.d.ts new file mode 100644 index 00000000000..9735749b9ab --- /dev/null +++ b/src/touchingpartutils/src/Shared/TouchingPartUtils.d.ts @@ -0,0 +1,4 @@ +export namespace TouchingPartUtils { + function getAllTouchingParts(part: BasePart): BasePart[]; + function getBoundingBoxParts(cframe: CFrame, size: Vector3): BasePart[]; +} diff --git a/src/trajectory/index.d.ts b/src/trajectory/index.d.ts new file mode 100644 index 00000000000..f1fb89fe21a --- /dev/null +++ b/src/trajectory/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/MinEntranceVelocityUtils'; +export * from './src/Shared/TrajectoryDrawUtils'; +export * from './src/Shared/trajectory'; diff --git a/src/trajectory/src/Shared/MinEntranceVelocityUtils.d.ts b/src/trajectory/src/Shared/MinEntranceVelocityUtils.d.ts new file mode 100644 index 00000000000..96683fe6f21 --- /dev/null +++ b/src/trajectory/src/Shared/MinEntranceVelocityUtils.d.ts @@ -0,0 +1,19 @@ +export namespace MinEntranceVelocityUtils { + function minimizeEntranceVelocity( + origin: Vector3, + target: Vector3, + accel: Vector3 + ): Vector3; + function computeEntranceVelocity( + velocity: Vector3, + origin: Vector3, + target: Vector3, + accel: Vector3 + ): Vector3; + function computeEntranceTime( + velocity: Vector3, + origin: Vector3, + target: Vector3, + accel: Vector3 + ): Vector3; +} diff --git a/src/trajectory/src/Shared/TrajectoryDrawUtils.d.ts b/src/trajectory/src/Shared/TrajectoryDrawUtils.d.ts new file mode 100644 index 00000000000..c1b18e652b0 --- /dev/null +++ b/src/trajectory/src/Shared/TrajectoryDrawUtils.d.ts @@ -0,0 +1,10 @@ +import { Maid } from '@quenty/maid'; + +export namespace TrajectoryDrawUtils { + function draw( + velocity: Vector3, + origin: Vector3, + target: Vector3, + accel: Vector3 + ): Maid; +} diff --git a/src/trajectory/src/Shared/trajectory.d.ts b/src/trajectory/src/Shared/trajectory.d.ts new file mode 100644 index 00000000000..0f663d69bf7 --- /dev/null +++ b/src/trajectory/src/Shared/trajectory.d.ts @@ -0,0 +1,17 @@ +export const trajectory: ( + origin: Vector3, + target: Vector3, + initialVelocity: number, + gravityForce: number +) => LuaTuple< + | [ + lowTrajectory: Vector3, + highTrajectory: Vector3, + fallbackTrajectory: undefined + ] + | [ + lowTrajectory: undefined, + highTrajectory: undefined, + fallbackTrajectory: Vector3 + ] +>; diff --git a/src/transitionmodel/index.d.ts b/src/transitionmodel/index.d.ts new file mode 100644 index 00000000000..cf1d17fd014 --- /dev/null +++ b/src/transitionmodel/index.d.ts @@ -0,0 +1,5 @@ +export * from './src/Shared/TransitionModel'; +export * from './src/Shared/TransitionUtils'; +export * from './src/Shared/Sustain/SustainModel'; +export * from './src/Shared/Timed/TimedTransitionModel'; +export * from './src/Shared/SpringTransitionModel'; diff --git a/src/transitionmodel/src/Shared/SpringTransitionModel.d.ts b/src/transitionmodel/src/Shared/SpringTransitionModel.d.ts new file mode 100644 index 00000000000..b744f4091d4 --- /dev/null +++ b/src/transitionmodel/src/Shared/SpringTransitionModel.d.ts @@ -0,0 +1,34 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Observable } from '@quenty/rx'; +import { LinearValue } from '@quenty/spring'; + +type Target = LinearValue | number; + +interface SpringTransitionModel extends BasicPane { + SetShowTarget(target?: T, doNotAnimate?: boolean): void; + SetHideTarget(target?: T, doNotAnimate?: boolean): void; + IsShowingComplete(): boolean; + IsHidingComplete(): boolean; + ObserveIsShowingComplete(): Observable; + ObserveIsHidingComplete(): Observable; + BindToPaneVisibility(pane: BasicPane): () => void; + GetVelocity(): T; + SetSpeed(speed: number | Observable): void; + SetDamper(damper: number | Observable): void; + ObserveRenderStepped(): Observable; + Observe(): Observable; + PromiseShow(doNotAnimate?: boolean): Promise; + PromiseHide(doNotAnimate?: boolean): Promise; + PromiseToggle(doNotAnimate?: boolean): Promise; +} + +interface SpringTransitionModelConstructor { + readonly ClassName: 'SpringTransitionModel'; + new (): SpringTransitionModel; + new ( + showTarget?: T, + hideTarget?: T + ): SpringTransitionModel; +} + +export const SpringTransitionModel: SpringTransitionModelConstructor; diff --git a/src/transitionmodel/src/Shared/Sustain/SustainModel.d.ts b/src/transitionmodel/src/Shared/Sustain/SustainModel.d.ts new file mode 100644 index 00000000000..f04b6d94a2f --- /dev/null +++ b/src/transitionmodel/src/Shared/Sustain/SustainModel.d.ts @@ -0,0 +1,19 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Maid } from '@quenty/maid'; + +interface SustainModel extends BaseObject { + SetPromiseSustain( + sustainCallback?: (maid: Maid, doNotAnimate?: boolean) => Promise + ): void; + SetIsSustained(isSustained: boolean, doNotAnimate?: boolean): void; + Sustain(doNotAnimate?: boolean): void; + Stop(doNotAnimate?: boolean): void; + PromiseSustain(doNotAnimate?: boolean): Promise; +} + +interface SustainModelConstructor { + readonly ClassName: 'SustainModel'; + new (): SustainModel; +} + +export const SustainModel: SustainModelConstructor; diff --git a/src/transitionmodel/src/Shared/Timed/TimedTransitionModel.d.ts b/src/transitionmodel/src/Shared/Timed/TimedTransitionModel.d.ts new file mode 100644 index 00000000000..e1d4b60b9a5 --- /dev/null +++ b/src/transitionmodel/src/Shared/Timed/TimedTransitionModel.d.ts @@ -0,0 +1,23 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Observable } from '@quenty/rx'; + +interface TimedTransitionModel extends BasicPane { + SetTransitionTime(transitionTime: number): void; + IsShowingComplete(): boolean; + IsHidingComplete(): boolean; + ObserveIsShowingComplete(): Observable; + ObserveIsHidingComplete(): Observable; + BindToPaneVisibility(pane: BasicPane): () => void; + ObserveRenderStepped(): Observable; + Observe(): Observable; + PromiseShow(doNotAnimate?: boolean): Promise; + PromiseHide(doNotAnimate?: boolean): Promise; + PromiseToggle(doNotAnimate?: boolean): Promise; +} + +interface TimedTransitionModelConstructor { + readonly ClassName: 'TimedTransitionModel'; + new (transitionTime?: number): TimedTransitionModel; +} + +export const TimedTransitionModel: TimedTransitionModelConstructor; diff --git a/src/transitionmodel/src/Shared/TransitionModel.d.ts b/src/transitionmodel/src/Shared/TransitionModel.d.ts new file mode 100644 index 00000000000..bdf7cc8b796 --- /dev/null +++ b/src/transitionmodel/src/Shared/TransitionModel.d.ts @@ -0,0 +1,29 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Observable } from '@quenty/rx'; +import { Maid } from '@quenty/maid'; + +interface TransitionModel extends BasicPane { + PromiseShow(doNotAnimate?: boolean): Promise; + promiseHide(doNotAnimate?: boolean): Promise; + promiseToggle(doNotAnimate?: boolean): Promise; + IsShowingComplete(): boolean; + IsHidingComplete(): boolean; + ObserveisShowingComplete(): Observable; + ObserveisHidingComplete(): Observable; + BindToPaneVisibility(pane: BasicPane): () => void; + SetPromiseShow( + showCallback?: (maid: Maid, doNotAnimate?: boolean) => Promise + ): void; + SetPromiseHide( + hideCallback?: (maid: Maid, doNotAnimate?: boolean) => Promise + ): void; +} + +interface TransitionModelConstructor { + readonly ClassName: 'TransitionModel'; + new (): TransitionModel; + + isTransitionModel: (value: unknown) => value is TransitionModel; +} + +export const TransitionModel: TransitionModelConstructor; diff --git a/src/transitionmodel/src/Shared/TransitionUtils.d.ts b/src/transitionmodel/src/Shared/TransitionUtils.d.ts new file mode 100644 index 00000000000..4276cb925e7 --- /dev/null +++ b/src/transitionmodel/src/Shared/TransitionUtils.d.ts @@ -0,0 +1,9 @@ +import { BasicPane } from '@quenty/basicpane'; + +export namespace TransitionUtils { + function isTransition(value: unknown): value is BasicPane & { + PromiseShow: (doNotAnimate?: boolean) => Promise; + PromiseHide: (doNotAnimate?: boolean) => Promise; + PromiseToggle: (doNotAnimate?: boolean) => Promise; + }; +} diff --git a/src/transparencyservice/index.d.ts b/src/transparencyservice/index.d.ts new file mode 100644 index 00000000000..76d67896ac0 --- /dev/null +++ b/src/transparencyservice/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/TransparencyService'; diff --git a/src/transparencyservice/src/Client/TransparencyService.d.ts b/src/transparencyservice/src/Client/TransparencyService.d.ts new file mode 100644 index 00000000000..01852b69206 --- /dev/null +++ b/src/transparencyservice/src/Client/TransparencyService.d.ts @@ -0,0 +1,18 @@ +export interface TransparencyService { + readonly ServiceName: 'TransparencyService'; + Init(): void; + IsDead(): boolean; + SetTransparency( + key: unknown, + part: Instance, + transparency: number | undefined + ): void; + SetLocalTransparencyModifier( + key: unknown, + part: Instance, + transparency: number | undefined + ): void; + ResetLocalTransparencyModifier(key: unknown, part: Instance): void; + ResetTransparency(key: unknown, part: Instance): void; + Destroy(): void; +} diff --git a/src/tuple/index.d.ts b/src/tuple/index.d.ts new file mode 100644 index 00000000000..603ddc724e0 --- /dev/null +++ b/src/tuple/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Tuple'; diff --git a/src/tuple/src/Shared/Tuple.d.ts b/src/tuple/src/Shared/Tuple.d.ts new file mode 100644 index 00000000000..0c7fa2869fc --- /dev/null +++ b/src/tuple/src/Shared/Tuple.d.ts @@ -0,0 +1,20 @@ +type Tuple = { + n: number; + + Unpack(): T extends [unknown, ...unknown[]] ? LuaTuple : T; + ToArray(): T extends [unknown, ...unknown[]] ? T : [T]; + __tostring(): string; + __len(): number; + __eq(other: Tuple): boolean; + _add(other: Tuple): Tuple; + __call(): T extends [unknown, ...unknown[]] ? LuaTuple : T; +}; + +interface TupleConstructor { + readonly ClassName: 'Tuple'; + new (value: T): Tuple; + new (...values: T): Tuple; + isTuple: (value: unknown) => value is Tuple; +} + +export const Tuple: TupleConstructor; diff --git a/src/typeutils/index.d.ts b/src/typeutils/index.d.ts new file mode 100644 index 00000000000..c903e747c17 --- /dev/null +++ b/src/typeutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/TypeUtils'; diff --git a/src/typeutils/src/Shared/TypeUtils.d.ts b/src/typeutils/src/Shared/TypeUtils.d.ts new file mode 100644 index 00000000000..7d708fda339 --- /dev/null +++ b/src/typeutils/src/Shared/TypeUtils.d.ts @@ -0,0 +1,3 @@ +export namespace TypeUtils { + function anyValue(value: unknown): any; +} diff --git a/src/ugcsanitize/index.d.ts b/src/ugcsanitize/index.d.ts new file mode 100644 index 00000000000..236d2c00cf7 --- /dev/null +++ b/src/ugcsanitize/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/DisableHatParticles'; diff --git a/src/ugcsanitize/src/Shared/DisableHatParticles.d.ts b/src/ugcsanitize/src/Shared/DisableHatParticles.d.ts new file mode 100644 index 00000000000..55fc1ec1e37 --- /dev/null +++ b/src/ugcsanitize/src/Shared/DisableHatParticles.d.ts @@ -0,0 +1,12 @@ +import { BaseObject } from '@quenty/baseobject'; + +interface DisableHatParticles extends BaseObject { + Destroy(): void; +} + +interface DisableHatParticlesConstructor { + readonly ClassName: 'DisableHatParticles'; + new (character: Model): DisableHatParticles; +} + +export const DisableHatParticles: DisableHatParticlesConstructor; diff --git a/src/uiobjectutils/index.d.ts b/src/uiobjectutils/index.d.ts new file mode 100644 index 00000000000..f6983c791f9 --- /dev/null +++ b/src/uiobjectutils/index.d.ts @@ -0,0 +1,8 @@ +export * from './src/Client/GuiInteractionUtils'; +export * from './src/Client/PlayerGuiUtils'; +export * from './src/Client/RxClippedRectUtils'; +export * from './src/Client/ScrollingDirectionUtils'; +export * from './src/Client/UIAlignmentUtils'; +export * from './src/Client/UICornerUtils'; +export * from './src/Client/UIPaddingUtils'; +export * from './src/Client/UIRotationUtils'; diff --git a/src/uiobjectutils/src/Client/GuiInteractionUtils.d.ts b/src/uiobjectutils/src/Client/GuiInteractionUtils.d.ts new file mode 100644 index 00000000000..698ea22d99d --- /dev/null +++ b/src/uiobjectutils/src/Client/GuiInteractionUtils.d.ts @@ -0,0 +1,9 @@ +import { Brio } from '@quenty/brio'; +import { Observable } from '@quenty/rx'; + +export namespace GuiInteractionUtils { + function observeInteractionEnabled(gui: GuiObject): Observable; + function observeInteractionEnabledBrio( + gui: GuiObject + ): Observable>; +} diff --git a/src/uiobjectutils/src/Client/PlayerGuiUtils.d.ts b/src/uiobjectutils/src/Client/PlayerGuiUtils.d.ts new file mode 100644 index 00000000000..d170dd14010 --- /dev/null +++ b/src/uiobjectutils/src/Client/PlayerGuiUtils.d.ts @@ -0,0 +1,4 @@ +export namespace PlayerGuiUtils { + function getPlayerGui(): PlayerGui; + function findPlayerGui(): PlayerGui | undefined; +} diff --git a/src/uiobjectutils/src/Client/RxClippedRectUtils.d.ts b/src/uiobjectutils/src/Client/RxClippedRectUtils.d.ts new file mode 100644 index 00000000000..08ad8fdef18 --- /dev/null +++ b/src/uiobjectutils/src/Client/RxClippedRectUtils.d.ts @@ -0,0 +1,6 @@ +import { Observable } from '@quenty/rx'; + +export namespace RxClippedRectUtils { + function observeClippedRect(gui: GuiObject): Observable; + function observeClippedRectInScale(gui: GuiObject): Observable; +} diff --git a/src/uiobjectutils/src/Client/ScrollingDirectionUtils.d.ts b/src/uiobjectutils/src/Client/ScrollingDirectionUtils.d.ts new file mode 100644 index 00000000000..26d5a6e9d05 --- /dev/null +++ b/src/uiobjectutils/src/Client/ScrollingDirectionUtils.d.ts @@ -0,0 +1,8 @@ +export namespace ScrollingDirectionUtils { + function canScrollHorizontal( + scrollingDirection: Enum.ScrollingDirection + ): boolean; + function canScrollVertical( + scrollingDirection: Enum.ScrollingDirection + ): boolean; +} diff --git a/src/uiobjectutils/src/Client/UIAlignmentUtils.d.ts b/src/uiobjectutils/src/Client/UIAlignmentUtils.d.ts new file mode 100644 index 00000000000..499b8dc7d92 --- /dev/null +++ b/src/uiobjectutils/src/Client/UIAlignmentUtils.d.ts @@ -0,0 +1,26 @@ +export namespace UIAlignmentUtils { + function toNumber( + alignment: Enum.HorizontalAlignment | Enum.VerticalAlignment + ): 0 | 0.5 | 1; + function verticalToHorizontalAlignment( + verticalAlignment: Enum.VerticalAlignment + ): Enum.HorizontalAlignment; + function horizontalToVerticalAlignment( + horizontalAlignment: Enum.HorizontalAlignment + ): Enum.VerticalAlignment; + function toBias( + alignment: Enum.HorizontalAlignment | Enum.VerticalAlignment + ): -1 | 0 | 1; + function horizontalAlignmentToNumber( + horizontalAlignment: Enum.HorizontalAlignment + ): 0 | 0.5 | 1; + function horizontalAlignmentToBias( + horizontalAlignment: Enum.HorizontalAlignment + ): -1 | 0 | 1; + function verticalAlignmentToNumber( + verticalAlignment: Enum.VerticalAlignment + ): 0 | 0.5 | 1; + function verticalAlignmentToBias( + verticalAlignment: Enum.VerticalAlignment + ): -1 | 0 | 1; +} diff --git a/src/uiobjectutils/src/Client/UICornerUtils.d.ts b/src/uiobjectutils/src/Client/UICornerUtils.d.ts new file mode 100644 index 00000000000..9cd81065311 --- /dev/null +++ b/src/uiobjectutils/src/Client/UICornerUtils.d.ts @@ -0,0 +1,10 @@ +export namespace UICornerUtils { + function fromScale(scale: number, parent?: Instance): UICorner; + function fromOffset(offset: number, parent?: Instance): UICorner; + function clampPositionToFrame( + framePosition: Vector2, + frameSize: Vector2, + radius: number, + point: Vector2 + ): LuaTuple<[position?: Vector2, normal?: Vector2]>; +} diff --git a/src/uiobjectutils/src/Client/UIPaddingUtils.d.ts b/src/uiobjectutils/src/Client/UIPaddingUtils.d.ts new file mode 100644 index 00000000000..a36e8e42526 --- /dev/null +++ b/src/uiobjectutils/src/Client/UIPaddingUtils.d.ts @@ -0,0 +1,6 @@ +export namespace UIPaddingUtils { + function fromUDim(udim: UDim): UIPadding; + function getTotalPadding(uiPadding: UIPadding): UDim2; + function getTotalAbsolutePadding(uiPadding: UIPadding): Vector2; + function getHorizontalPadding(uiPadding: UIPadding): UDim; +} diff --git a/src/uiobjectutils/src/Client/UIRotationUtils.d.ts b/src/uiobjectutils/src/Client/UIRotationUtils.d.ts new file mode 100644 index 00000000000..d7bddc6fd82 --- /dev/null +++ b/src/uiobjectutils/src/Client/UIRotationUtils.d.ts @@ -0,0 +1,5 @@ +export namespace UIRotationUtils { + function toUnitCircle(rotationDegrees: number): number; + function toUnitCircleDirection(rotationDegrees: number): Vector2; + function toGuiDirection(unitCircleDirection: Vector2): Vector2; +} diff --git a/src/ultrawidecontainerutils/index.d.ts b/src/ultrawidecontainerutils/index.d.ts new file mode 100644 index 00000000000..5d405f839b5 --- /dev/null +++ b/src/ultrawidecontainerutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Client/UltrawideContainerUtils'; diff --git a/src/ultrawidecontainerutils/src/Client/UltrawideContainerUtils.d.ts b/src/ultrawidecontainerutils/src/Client/UltrawideContainerUtils.d.ts new file mode 100644 index 00000000000..72ce3deeb8c --- /dev/null +++ b/src/ultrawidecontainerutils/src/Client/UltrawideContainerUtils.d.ts @@ -0,0 +1,10 @@ +export namespace UltrawideContainerUtils { + function createContainer( + parent?: Instance + ): LuaTuple<[Frame, UISizeConstraint]>; + function scaleSizeConstraint( + container: Frame, + uiSizeConstraint: UISizeConstraint, + scale: number + ): void; +} diff --git a/src/undostack/index.d.ts b/src/undostack/index.d.ts new file mode 100644 index 00000000000..c0081af8879 --- /dev/null +++ b/src/undostack/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/UndoStack'; +export * from './src/Shared/UndoStackEntry'; diff --git a/src/undostack/src/Shared/UndoStack.d.ts b/src/undostack/src/Shared/UndoStack.d.ts new file mode 100644 index 00000000000..9e6373d93d7 --- /dev/null +++ b/src/undostack/src/Shared/UndoStack.d.ts @@ -0,0 +1,24 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Observable } from '@quenty/rx'; +import { UndoStackEntry } from './UndoStackEntry'; +import { Promise } from '@quenty/promise'; + +interface UndoStack extends BaseObject { + ClearRedoStack(): void; + IsActionExecuting(): boolean; + ObserveHasUndoEntries(): Observable; + ObserveHasRedoEntries(): Observable; + HasUndoEntries(): boolean; + HasRedoEntries(): boolean; + Push(undoStackEntry: UndoStackEntry): () => void; + Remove(undoStackEntry: UndoStackEntry): void; + PromiseUndo(): Promise; + PromiseRedo(): Promise; +} + +interface UndoStackConstructor { + readonly ClassName: 'UndoStack'; + new (maxSize?: number): UndoStack; +} + +export const UndoStack: UndoStackConstructor; diff --git a/src/undostack/src/Shared/UndoStackEntry.d.ts b/src/undostack/src/Shared/UndoStackEntry.d.ts new file mode 100644 index 00000000000..66410071bdb --- /dev/null +++ b/src/undostack/src/Shared/UndoStackEntry.d.ts @@ -0,0 +1,23 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Maid } from '@quenty/maid'; +import { Promise } from '@quenty/promise'; +import { Signal } from '@quenty/signal'; + +interface UndoStackEntry extends BaseObject { + Destroying: Signal; + SetPromiseUndo(promiseUndo?: (maid: Maid) => Promise | unknown): void; + SetPromiseRedo(promiseUndo?: (maid: Maid) => Promise | unknown): void; + HasUndo(): boolean; + HasRedo(): boolean; + PromiseUndo(maid: Maid): Promise; + PromiseRedo(maid: Maid): Promise; +} + +interface UndoStackEntryConstructor { + readonly ClassName: 'UndoStackEntry'; + new (): UndoStackEntry; + + isUndoStackEntry: (value: unknown) => value is UndoStackEntry; +} + +export const UndoStackEntry: UndoStackEntryConstructor; diff --git a/src/userserviceutils/index.d.ts b/src/userserviceutils/index.d.ts new file mode 100644 index 00000000000..b8a7ed17271 --- /dev/null +++ b/src/userserviceutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/UserInfoAggregator'; +export * from './src/Shared/UserInfoService'; +export * from './src/Shared/UserServiceUtils'; diff --git a/src/userserviceutils/src/Shared/UserInfoAggregator.d.ts b/src/userserviceutils/src/Shared/UserInfoAggregator.d.ts new file mode 100644 index 00000000000..974310e7cba --- /dev/null +++ b/src/userserviceutils/src/Shared/UserInfoAggregator.d.ts @@ -0,0 +1,21 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; + +interface UserInfoAggregator extends BaseObject { + PromiseUserInfo(userId: number): Promise; + PromiseDisplayName(userId: number): Promise; + PromiseUsername(userId: number): Promise; + PromiseHasVerifiedBadge(userId: number): Promise; + ObserveUserInfo(userId: number): Observable; + ObserveDisplayName(userId: number): Observable; + ObserveUsername(userId: number): Observable; + ObserveHasVerifiedBadge(userId: number): Observable; +} + +interface UserInfoAggregatorConstructor { + readonly ClassName: 'UserInfoAggregator'; + new (): UserInfoAggregator; +} + +export const UserInfoAggregator: UserInfoAggregatorConstructor; diff --git a/src/userserviceutils/src/Shared/UserInfoService.d.ts b/src/userserviceutils/src/Shared/UserInfoService.d.ts new file mode 100644 index 00000000000..f52f5877f1e --- /dev/null +++ b/src/userserviceutils/src/Shared/UserInfoService.d.ts @@ -0,0 +1,14 @@ +import { Promise } from '@quenty/promise'; +import { Observable } from '@quenty/rx'; +import { ServiceBag } from '@quenty/servicebag'; + +export interface UserInfoService { + readonly ServiceName: 'UserInfoService'; + Init(serviceBag: ServiceBag): void; + PromiseUserInfo(userId: number): Promise; + ObserveUserInfo(userId: number): Observable; + PromiseDisplayName(userId: number): Promise; + PromiseUsername(userId: number): Promise; + ObserveDisplayName(userId: number): Observable; + Destroy(): void; +} diff --git a/src/userserviceutils/src/Shared/UserServiceUtils.d.ts b/src/userserviceutils/src/Shared/UserServiceUtils.d.ts new file mode 100644 index 00000000000..cc07413102f --- /dev/null +++ b/src/userserviceutils/src/Shared/UserServiceUtils.d.ts @@ -0,0 +1,8 @@ +import { Promise } from '@quenty/promise'; + +export namespace UserServiceUtils { + function promiseUserInfosByUserIds(userIds: number[]): Promise; + function promiseUserInfo(userId: number): Promise; + function promiseDisplayName(userId: number): Promise; + function promiseUserName(userId: number): Promise; +} diff --git a/src/utf8/index.d.ts b/src/utf8/index.d.ts new file mode 100644 index 00000000000..20b81570091 --- /dev/null +++ b/src/utf8/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/UTF8'; diff --git a/src/utf8/src/Shared/UTF8.d.ts b/src/utf8/src/Shared/UTF8.d.ts new file mode 100644 index 00000000000..5a48134057c --- /dev/null +++ b/src/utf8/src/Shared/UTF8.d.ts @@ -0,0 +1,7 @@ +export namespace UTF8 { + const UPPER_MAP: Readonly>; + const LOWER_MAP: Readonly>; + + function upper(str: string): string; + function lower(str: string): string; +} diff --git a/src/valuebaseutils/index.d.ts b/src/valuebaseutils/index.d.ts new file mode 100644 index 00000000000..ceaa594aa03 --- /dev/null +++ b/src/valuebaseutils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/RxValueBaseUtils'; +export * from './src/Shared/ValueBaseUtils'; +export * from './src/Shared/ValueBaseValue'; diff --git a/src/valuebaseutils/src/Shared/RxValueBaseUtils.d.ts b/src/valuebaseutils/src/Shared/RxValueBaseUtils.d.ts new file mode 100644 index 00000000000..3ea708e9b7f --- /dev/null +++ b/src/valuebaseutils/src/Shared/RxValueBaseUtils.d.ts @@ -0,0 +1,18 @@ +import { Brio } from '../../../brio'; +import { Observable, Predicate } from '../../../rx'; + +export namespace RxValueBaseUtils { + function observeBrio( + parent: Instance, + className: C, + name: string, + predicate?: Predicate + ): Observable>; + function observe( + parent: Instance, + className: C, + name: string, + defaultValue?: V + ): Observable; + function observeValue(valueObject: ValueBase): Observable; +} diff --git a/src/valuebaseutils/src/Shared/ValueBaseUtils.d.ts b/src/valuebaseutils/src/Shared/ValueBaseUtils.d.ts new file mode 100644 index 00000000000..59a127faa77 --- /dev/null +++ b/src/valuebaseutils/src/Shared/ValueBaseUtils.d.ts @@ -0,0 +1,51 @@ +type InstancesInheritingValueBase = { + [K in keyof Instances]: Instances[K] extends ValueBase + ? K extends 'ValueBase' + ? never + : K + : never; +}; + +type ValueBaseType = + InstancesInheritingValueBase[keyof InstancesInheritingValueBase]; + +export namespace ValueBaseUtils { + function isValueBase(instance: Instance): instance is ValueBase; + function getValueBaseType( + valueBaseClassName: ValueBaseType + ): string | undefined; + function getClassNameFromType(luaType: string): ValueBaseType | undefined; + function getOrCreateValue( + parent: Instance, + instanceType: ValueBaseType, + name: string, + defaultValue?: unknown + ): Instance; + function setValue( + parent: Instance, + instanceType: ValueBaseType, + name: string, + value: unknown + ): void; + function getValue( + parent: Instance, + instanceType: ValueBaseType, + name: string + ): T | undefined; + function getValue( + parent: Instance, + instanceType: ValueBaseType, + name: string, + defaultValue: T + ): T; + function createGetSet( + instanceType: ValueBaseType, + name: string + ): LuaTuple< + [ + getter: (parent: Instance, defaultValue?: T) => T | undefined, + setter: (parent: Instance, value?: T) => T | undefined, + initializer: (parent: Instance, defaultValue?: T) => T | undefined + ] + >; +} diff --git a/src/valuebaseutils/src/Shared/ValueBaseValue.d.ts b/src/valuebaseutils/src/Shared/ValueBaseValue.d.ts new file mode 100644 index 00000000000..489854fda5c --- /dev/null +++ b/src/valuebaseutils/src/Shared/ValueBaseValue.d.ts @@ -0,0 +1,19 @@ +import { RxSignal } from '@quenty/rxsignal'; +import { ValueBaseType } from './ValueBaseUtils'; +import { ValueObjectLike } from '@quenty/valueobject'; + +interface ValueBaseValue extends ValueObjectLike { + Changed: RxSignal; +} + +interface ValueBaseValueConstructor { + readonly ClassName: 'ValueBaseValue'; + new ( + parent: Instance, + className: ValueBaseType, + name: string, + defaultValue?: T + ): ValueBaseValue; +} + +export const ValueBaseValue: ValueBaseValueConstructor; diff --git a/src/valueobject/index.d.ts b/src/valueobject/index.d.ts new file mode 100644 index 00000000000..b220c589fe4 --- /dev/null +++ b/src/valueobject/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Shared/ValueObject'; +export * from './src/Shared/ValueObjectUtils'; diff --git a/src/valueobject/src/Shared/ValueObject.d.ts b/src/valueobject/src/Shared/ValueObject.d.ts new file mode 100644 index 00000000000..b33568b4fbe --- /dev/null +++ b/src/valueobject/src/Shared/ValueObject.d.ts @@ -0,0 +1,45 @@ +import { Brio } from '@quenty/brio'; +import { MaidTask } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; +import { Signal } from '@quenty/signal'; + +export interface ValueObjectLike { + Value: T; + Observe(): Observable; + ObserveBrio(): Observable>; + ObserveBrio( + predicate: (value: T) => value is NonNullable + ): Observable>>; + ObserveBrio( + predicate: (value: T) => value is Exclude> + ): Observable>>>; + ObserveBrio(predicate: (value: T) => boolean): Observable>; +} + +type CheckType = + | keyof CheckableTypes + | ((value: unknown) => LuaTuple<[boolean, string?]>); + +export type Mountable = T | Observable | ValueBase | ValueObject; + +export interface ValueObject extends ValueObjectLike { + Value: T; + Changed: Signal>; + GetCheckType(): CheckType | undefined; + Mount(value: T | Observable): MaidTask; + SetValue(value: T): void; + Destroy(): void; +} + +interface ValueObjectConstructor { + readonly ClassName: 'ValueObject'; + new (): ValueObject; + new (value: T, checkType?: CheckType): ValueObject; + + fromObservable: (observable: Observable) => ValueObject; + isValueObject: (value: unknown) => value is ValueObject; +} + +export const ValueObject: ValueObjectConstructor; + +export {}; diff --git a/src/valueobject/src/Shared/ValueObjectUtils.d.ts b/src/valueobject/src/Shared/ValueObjectUtils.d.ts new file mode 100644 index 00000000000..ba6ad9a17cd --- /dev/null +++ b/src/valueobject/src/Shared/ValueObjectUtils.d.ts @@ -0,0 +1,21 @@ +import { Brio } from '@quenty/brio'; +import { Maid } from '@quenty/maid'; +import { Observable } from '@quenty/rx'; +import { ValueObject } from './ValueObject'; +import { Signal } from '@quenty/signal'; + +interface ValueChangedObjectLike { + Value: T; + Changed: Signal | Signal; +} + +export namespace ValueObjectUtils { + function syncValue( + from: ValueChangedObjectLike, + to: ValueChangedObjectLike + ): Maid; + function observeValue(valueObject: ValueObject): Observable; + function observeValueBrio( + valueObject: ValueObject + ): Observable>; +} diff --git a/src/vector3int16utils/index.d.ts b/src/vector3int16utils/index.d.ts new file mode 100644 index 00000000000..413eee93d5a --- /dev/null +++ b/src/vector3int16utils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/Vector3int16Utils'; diff --git a/src/vector3int16utils/src/Shared/Vector3int16Utils.d.ts b/src/vector3int16utils/src/Shared/Vector3int16Utils.d.ts new file mode 100644 index 00000000000..2d683915fe4 --- /dev/null +++ b/src/vector3int16utils/src/Shared/Vector3int16Utils.d.ts @@ -0,0 +1,3 @@ +export namespace Vector3int16Utils { + function fromVector3(vector3: Vector3): Vector3int16; +} diff --git a/src/vector3utils/index.d.ts b/src/vector3utils/index.d.ts new file mode 100644 index 00000000000..9148eb873ba --- /dev/null +++ b/src/vector3utils/index.d.ts @@ -0,0 +1,3 @@ +export * from './src/Shared/Vector3Utils'; +export * from './src/Shared/RandomVector3Utils'; +export * from './src/Shared/Vector3SerializationUtils'; diff --git a/src/vector3utils/src/Shared/RandomVector3Utils.d.ts b/src/vector3utils/src/Shared/RandomVector3Utils.d.ts new file mode 100644 index 00000000000..ecdb829944f --- /dev/null +++ b/src/vector3utils/src/Shared/RandomVector3Utils.d.ts @@ -0,0 +1,8 @@ +export namespace RandomVector3Utils { + function getRandomUnitVector(): Vector3; + function gaussianRandom(mean: Vector3, spread: Vector3): Vector3; + function getDirectedRandomUnitVector( + direction: Vector3, + angleRad: number + ): Vector3; +} diff --git a/src/vector3utils/src/Shared/Vector3SerializationUtils.d.ts b/src/vector3utils/src/Shared/Vector3SerializationUtils.d.ts new file mode 100644 index 00000000000..dbeaefdb888 --- /dev/null +++ b/src/vector3utils/src/Shared/Vector3SerializationUtils.d.ts @@ -0,0 +1,9 @@ +export type SerializedVector3 = [x: number, y: number, z: number] & { + __brand: 'SerializedVector3'; +}; + +export namespace Vector3SerializationUtils { + function isSerializedVector3(value: unknown): value is SerializedVector3; + function serialize(vector3: Vector3): SerializedVector3; + function deserialize(serializedVector3: SerializedVector3): Vector3; +} diff --git a/src/vector3utils/src/Shared/Vector3Utils.d.ts b/src/vector3utils/src/Shared/Vector3Utils.d.ts new file mode 100644 index 00000000000..b816253bbf4 --- /dev/null +++ b/src/vector3utils/src/Shared/Vector3Utils.d.ts @@ -0,0 +1,15 @@ +export namespace Vector3Utils { + function fromVector2XY(vector2: Vector2): Vector3; + function fromVector2XZ(vector2: Vector2): Vector3; + function getAngleRad(a: Vector3, b: Vector3): number | undefined; + function reflect(vector: Vector3, unitNormal: Vector3): Vector3; + function angleBetweenVectors(a: Vector3, b: Vector3): number; + function slerp(start: Vector3, finish: Vector3, t: number): Vector3; + function constrainToCone( + direction: Vector3, + coneDirection: Vector3, + coneAngleRad: number + ): Vector3; + function round(vector3: Vector3, amount: number): Vector3; + function areClose(a: Vector3, b: Vector3, epsilon: number): boolean; +} diff --git a/src/viewport/index.d.ts b/src/viewport/index.d.ts new file mode 100644 index 00000000000..cf77d6fafee --- /dev/null +++ b/src/viewport/index.d.ts @@ -0,0 +1,2 @@ +export * from './src/Client/Viewport'; +export * from './src/Client/ViewportControls'; diff --git a/src/viewport/src/Client/Viewport.d.ts b/src/viewport/src/Client/Viewport.d.ts new file mode 100644 index 00000000000..abeecf2123e --- /dev/null +++ b/src/viewport/src/Client/Viewport.d.ts @@ -0,0 +1,28 @@ +import { BasicPane } from '@quenty/basicpane'; +import { Observable } from '@quenty/rx'; + +interface Viewport extends BasicPane { + ObserveTransparency(): Observable; + SetControlsEnabled(enabled: boolean): void; + SetTransparency(transparency: number | undefined): void; + SetFieldOfView(fieldOfView: number | undefined): void; + SetInstance(instance: Instance | undefined): void; + NotifyInstanceSizeChanged(): void; + SetYaw(yaw: number, doNotAnimate?: boolean): void; + SetPitch(pitch: number, doNotAnimate?: boolean): void; + RotateBy(deltaV2: Vector2, doNotAnimate?: boolean): void; + Render( + props: Partial> + ): Observable; +} + +interface ViewportConstructor { + readonly ClassName: 'Viewport'; + new (): Viewport; + + blend: ( + props: Partial> + ) => Observable; +} + +export const Viewport: ViewportConstructor; diff --git a/src/viewport/src/Client/ViewportControls.d.ts b/src/viewport/src/Client/ViewportControls.d.ts new file mode 100644 index 00000000000..c2fa5d1fe0a --- /dev/null +++ b/src/viewport/src/Client/ViewportControls.d.ts @@ -0,0 +1,13 @@ +import { BaseObject } from '@quenty/baseobject'; +import { Viewport } from './Viewport'; + +interface ViewportControls extends BaseObject { + SetEnabled(enabled: boolean): void; +} + +interface ViewportControlsConstructor { + readonly ClassName: 'ViewportControls'; + new (viewport: ViewportFrame, viewportObject: Viewport): ViewportControls; +} + +export const ViewportControls: ViewportControlsConstructor; diff --git a/src/voicechat/index.d.ts b/src/voicechat/index.d.ts new file mode 100644 index 00000000000..956a3313a3b --- /dev/null +++ b/src/voicechat/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/VoiceChatUtils'; diff --git a/src/voicechat/src/Shared/VoiceChatUtils.d.ts b/src/voicechat/src/Shared/VoiceChatUtils.d.ts new file mode 100644 index 00000000000..b6310aa113d --- /dev/null +++ b/src/voicechat/src/Shared/VoiceChatUtils.d.ts @@ -0,0 +1,6 @@ +import { Promise } from '@quenty/promise'; + +export namespace VoiceChatUtils { + function promiseIsVoiceEnabledForPlayer(player: Player): Promise; + function promiseIsVoiceEnabledForUserId(userId: number): Promise; +} diff --git a/src/weldconstraintutils/index.d.ts b/src/weldconstraintutils/index.d.ts new file mode 100644 index 00000000000..168125c2f1d --- /dev/null +++ b/src/weldconstraintutils/index.d.ts @@ -0,0 +1 @@ +export * from './src/Shared/WeldConstraintUtils'; diff --git a/src/weldconstraintutils/src/Shared/WeldConstraintUtils.d.ts b/src/weldconstraintutils/src/Shared/WeldConstraintUtils.d.ts new file mode 100644 index 00000000000..eebb05dd033 --- /dev/null +++ b/src/weldconstraintutils/src/Shared/WeldConstraintUtils.d.ts @@ -0,0 +1,14 @@ +export namespace WeldConstraintUtils { + function namedBetween( + name: string, + part0: BasePart, + part1: BasePart, + parent?: Instance + ): Weld | WeldConstraint; + function namedBetweenForceWeldConstraint( + name: string, + part0: BasePart, + part1: BasePart, + parent?: Instance + ): WeldConstraint; +} diff --git a/tsconfig.json b/tsconfig.json index 14b2d8d5f76..13bc72ad0a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,15 @@ "removeComments": false, "sourceMap": true, "strict": true, + "typeRoots": [ + "node_modules/@rbxts", + "node_modules/@quenty" + ], "target": "ES2022", + "baseUrl": ".", + "paths": { + "@quenty/*": ["src/*"] + }, "skipLibCheck": true }, "types": ["node"]