UNPKG

@empirica/core

Version:
53 lines (50 loc) 2.1 kB
import { S as Step, T as TajribaProvider } from './provider-4150a447.js'; import { BehaviorSubject } from 'rxjs'; import { C as Constructor, G as Globals } from './scopes-eb5984a4.js'; import { S as Scope } from './scopes-b6add333.js'; declare class Game extends Scope<Context, EmpiricaClassicKinds> { get hasEnded(): boolean; get stage(): Stage | undefined; get round(): Round | undefined; } declare class Player extends Scope<Context, EmpiricaClassicKinds> { get game(): PlayerGame | undefined; get round(): PlayerRound | undefined; get stage(): PlayerStage | undefined; hasUpdated(): boolean; } declare class PlayerGame extends Scope<Context, EmpiricaClassicKinds> { } declare class PlayerRound extends Scope<Context, EmpiricaClassicKinds> { } declare class PlayerStage extends Scope<Context, EmpiricaClassicKinds> { } declare class Round extends Scope<Context, EmpiricaClassicKinds> { } declare class Stage extends Scope<Context, EmpiricaClassicKinds> { get round(): Round | undefined; get timer(): Step | undefined; } declare class Context { game?: Game | null; stage?: Stage | null; } declare type EmpiricaClassicKinds = { game: Constructor<Game>; player: Constructor<Player>; playerGame: Constructor<PlayerGame>; playerRound: Constructor<PlayerRound>; playerStage: Constructor<PlayerStage>; round: Constructor<Round>; stage: Constructor<Stage>; }; declare type EmpiricaClassicContext = { game: BehaviorSubject<Game | null | undefined>; player: BehaviorSubject<Player | null | undefined>; players: BehaviorSubject<Player[] | undefined>; round: BehaviorSubject<Round | null | undefined>; stage: BehaviorSubject<Stage | null | undefined>; globals: BehaviorSubject<Globals | undefined>; }; declare function EmpiricaClassic(participantID: string, provider: TajribaProvider): EmpiricaClassicContext; export { Context as C, EmpiricaClassic as E, Game as G, Player as P, Round as R, Stage as S, PlayerGame as a, PlayerRound as b, PlayerStage as c, EmpiricaClassicContext as d, EmpiricaClassicKinds as e };