warscript
Version:
A typescript library for Warcraft III using Warpack.
19 lines (18 loc) • 816 B
TypeScript
/// <reference types="@warscript/language-extensions" />
/// <reference types="@typescript-to-lua/language-extensions" />
/** @noSelfInFile */
interface IBitSet<T extends number> {
readonly has: LuaBitwiseAndEqualsRightMethod<T>;
readonly hasAny: LuaBitwiseAndUnequalsZeroMethod<this>;
readonly intersect: LuaBitwiseAndMethod<this, this>;
readonly union: LuaBitwiseOrMethod<this, this>;
readonly with: LuaBitwiseOrMethod<T, this>;
readonly without: LuaBitwiseAndNotMethod<T, this>;
}
/**
* Typically, T should be a const enum, with each value being a power of two.
*/
export type BitSet<T extends number> = number & IBitSet<T>;
export declare const emptyBitSet: <T extends number>() => BitSet<T>;
export declare const bitSetOf: <T extends number>(...elements: T[]) => BitSet<T>;
export {};