import { type Entity, type Trait, type World } from 'koota';
type AoSFactory = () => unknown;
type Schema = {
    [key: string]: number | bigint | string | boolean | null | undefined | (() => unknown);
} | AoSFactory | Record<string, never>;
type TraitRecordFromSchema<T extends Schema> = T extends AoSFactory ? ReturnType<T> : {
    [P in keyof T]: T[P] extends (...args: never[]) => unknown ? ReturnType<T[P]> : T[P];
};
/**
 * The record of a trait.
 * For SoA it is a snapshot of the state for a single entity.
 * For AoS it is the state instance for a single entity.
 */
type TraitRecord<T extends Trait | Schema> = T extends Trait ? TraitRecordFromSchema<T['schema']> : TraitRecordFromSchema<T>;
export declare function isWorld(target: Entity | World | null | undefined): target is World;
export declare function useTrait<T extends Trait>(target: () => Entity | World | undefined | null, trait: T): {
    current: TraitRecord<T> | undefined;
};
export {};
