diff --git a/src/index.d.ts b/src/index.d.ts index 66ae62d..c485367 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,5 +1,20 @@ type Query = { - without: (...components: Entity[]) => Query; + + /** + * this: Query is necessary to use a colon instead of a period for emits. + */ + + /** + * Modifies the Query to exclude specified components + * @param components The components to exclude + * @returns Modified Query + */ + without: (this: Query, ...components: Entity[]) => Query; + /** + * Modifies component data with a callback function + * @param fn The function to modify data + */ + replace: (this: Query, fn: (...components: T) => T extends [infer U] ? U : LuaTuple) => void } & IterableFunction>; // Utility Types @@ -126,7 +141,7 @@ export class World { /** * Searches the world for entities that match a given query * @param components Queried Components - * @returns Iterable function + * @returns Query */ query(...components: T): Query>; } @@ -146,6 +161,11 @@ export const pair: (pred: Entity, obj: Entity) => Entity; */ export const IS_PAIR: (e: Entity) => boolean; +/** + * Built-in Component used to find every component id + */ +export const Component: Entity; + export const OnAdd: Entity; export const OnRemove: Entity; export const OnSet: Entity;