UNPKG

@rbxts/zircon

Version:

<div> <img src="https://i.imgur.com/YgpbX7G.png" align="left" width="128"/> <h1>ZIRCON</h1> <h3>A clean, sleek, runtime debugging console for Roblox</h3> <a href="https://npmjs.com/package/@rbxts/zircon"><img src="https://badge.fury.io

29 lines (28 loc) 1.51 kB
/// <reference types="@rbxts/compiler-types" /> import ZrContext from "@rbxts/zirconium/out/Data/Context"; import { ZrValue } from "@rbxts/zirconium/out/Data/Locals"; import ZrLuauFunction from "@rbxts/zirconium/out/Data/LuauFunction"; import ZrObject from "@rbxts/zirconium/out/Data/Object"; import ZrUndefined from "@rbxts/zirconium/out/Data/Undefined"; export declare type ZrTypeCheck = (value: ZrValue | ZrUndefined) => value is ZrValue | ZrUndefined; declare type ZrInferValue<T> = T extends (value: unknown) => value is infer A ? A : never; declare type InferArguments<T> = { readonly [P in keyof T]: ZrInferValue<T[P]>; }; export interface CommandDeclaration<A extends ReadonlyArray<ZrTypeCheck>, R> { Groups: string[]; Arguments: A; Execute: (this: void, context: ZrContext, ...args: InferArguments<A>) => R; } /** @deprecated */ export default class ZirconFunction<A extends readonly ZrTypeCheck[], R = unknown> extends ZrLuauFunction { private declaration; private constructor(); static create<A extends ReadonlyArray<ZrTypeCheck>, R>(declaration: CommandDeclaration<A, R>): ZirconFunction<A, R>; static readonly string: (value: unknown) => value is string; static readonly number: (value: unknown) => value is number; static readonly boolean: (value: unknown) => value is boolean; static readonly array: (value: unknown) => value is ZrValue[]; static readonly object: (value: unknown) => value is ZrObject; } export {};