UNPKG

@onlyworlds/sdk

Version:

TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety

1,099 lines (1,096 loc) 32 kB
/** * Base fields shared by all OnlyWorlds elements */ interface BaseElement { id?: string; name: string; description?: string; image_url?: string; supertype?: string; subtype?: string; world?: string; created_at?: string; updated_at?: string; } /** * World element type */ interface World { id?: string; api_key: string; name: string; description?: string; version?: string; image_url?: string; time_format_equivalents?: any[]; time_format_names?: any[]; time_basic_unit?: string; time_range_min?: number; time_range_max?: number; time_current?: number; user?: string; created_at?: string; updated_at?: string; } /** * World input type for creation/updates */ interface WorldInput { name: string; description?: string; version?: string; image_url?: string; time_format_equivalents?: any[]; time_format_names?: any[]; time_basic_unit?: string; time_range_min?: number; time_range_max?: number; time_current?: number; } /** * Ability element type */ interface Ability extends BaseElement { activation?: string; duration?: string; potency?: string; range?: string; challenges?: string; prevalence?: string; /** Links to Construct */ tradition?: string; /** Links to Phenomenon */ source?: string; /** Links to Location */ locus?: string; /** Links to Phenomenon */ effects?: string[]; /** Links to Trait */ talents?: string[]; /** Links to Construct */ requisites?: string[]; /** Links to Object */ instruments?: string[]; /** Links to Construct */ systems?: string[]; } /** * Object element type */ interface Object$1 extends BaseElement { aesthetics?: string; weight?: string; amount?: string; /** Links to Object */ parent_object?: string; utility?: string; origins?: string; /** Links to Location */ location?: string; /** Links to Language */ language?: string; /** Links to Construct */ materials?: string[]; /** Links to Construct */ technology?: string[]; /** Links to Phenomenon */ effects?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Construct */ consumes?: string[]; /** Links to Trait */ affinities?: string[]; } /** * Character element type */ interface Character extends BaseElement { physicality?: string; mentality?: string; height?: string; weight?: string; background?: string; motivations?: string; birth_date?: string; /** Links to Location */ birthplace?: string; reputation?: string; /** Links to Location */ location?: string; charisma?: string; coercion?: string; competence?: string; compassion?: string; creativity?: string; courage?: string; level?: string; hit_points?: string; STR?: string; DEX?: string; CON?: string; INT?: string; WIS?: string; CHA?: string; /** Links to Species */ species?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Language */ languages?: string[]; /** Links to Object */ objects?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Family */ family?: string[]; /** Links to Character */ friends?: string[]; /** Links to Character */ rivals?: string[]; } /** * Collective element type */ interface Collective extends BaseElement { composition?: string; count?: string; formation_date?: string; /** Links to Institution */ operator?: string; activity?: string; disposition?: string; state?: string; /** Links to Construct */ equipment?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Construct */ symbolism?: string[]; /** Links to Species */ species?: string[]; /** Links to Character */ characters?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Phenomenon */ phenomena?: string[]; } /** * Construct element type */ interface Construct extends BaseElement { rationale?: string; history?: string; status?: string; reach?: string; start_date?: string; end_date?: string; /** Links to Character */ founder?: string; /** Links to Institution */ custodian?: string; /** Links to Character */ characters?: string[]; /** Links to Object */ objects?: string[]; /** Links to Location */ locations?: string[]; /** Links to Species */ species?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Collective */ collectives?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Language */ languages?: string[]; /** Links to Family */ families?: string[]; /** Links to Relation */ relations?: string[]; /** Links to Title */ titles?: string[]; /** Links to Construct */ constructs?: string[]; /** Links to Event */ events?: string[]; /** Links to Narrative */ narratives?: string[]; } /** * Creature element type */ interface Creature extends BaseElement { appearance?: string; weight?: string; height?: string; habits?: string; demeanor?: string; status?: string; birth_date?: string; /** Links to Location */ location?: string; /** Links to Zone */ zone?: string; challenge_rating?: string; hit_points?: string; armor_class?: string; speed?: string; /** Links to Species */ species?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Language */ languages?: string[]; /** Links to Ability */ actions?: string[]; } /** * Event element type */ interface Event extends BaseElement { history?: string; challenges?: string; consequences?: string; start_date?: string; end_date?: string; /** Links to Event */ triggers?: string[]; /** Links to Character */ characters?: string[]; /** Links to Object */ objects?: string[]; /** Links to Location */ locations?: string[]; /** Links to Species */ species?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Collective */ collectives?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Language */ languages?: string[]; /** Links to Family */ families?: string[]; /** Links to Relation */ relations?: string[]; /** Links to Title */ titles?: string[]; /** Links to Construct */ constructs?: string[]; } /** * Family element type */ interface Family extends BaseElement { spirit?: string; history?: string; reputation?: string; /** Links to Construct */ traditions?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Language */ languages?: string[]; /** Links to Character */ ancestors?: string[]; /** Links to Location */ estates?: string[]; /** Links to Institution */ governs?: string[]; /** Links to Object */ heirlooms?: string[]; /** Links to Creature */ creatures?: string[]; } /** * Institution element type */ interface Institution extends BaseElement { doctrine?: string; founding_date?: string; /** Links to Institution */ parent_institution?: string; status?: string; /** Links to Zone */ zones?: string[]; /** Links to Object */ objects?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Institution */ allies?: string[]; /** Links to Institution */ adversaries?: string[]; /** Links to Construct */ constructs?: string[]; } /** * Language element type */ interface Language extends BaseElement { phonology?: string; grammar?: string; lexicon?: string; writing?: string; /** Links to Construct */ classification?: string; status?: string; /** Links to Location */ spread?: string[]; /** Links to Language */ dialects?: string[]; } /** * Law element type */ interface Law extends BaseElement { declaration?: string; purpose?: string; date?: string; /** Links to Law */ parent_law?: string; /** Links to Institution */ author?: string; /** Links to Construct */ penalties?: string[]; /** Links to Location */ locations?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Construct */ prohibitions?: string[]; /** Links to Title */ adjudicators?: string[]; /** Links to Title */ enforcers?: string[]; } /** * Location element type */ interface Location extends BaseElement { form?: string; function?: string; founding_date?: string; /** Links to Location */ parent_location?: string; political_climate?: string; /** Links to Institution */ primary_power?: string; /** Links to Title */ governing_title?: string; /** Links to Zone */ zone?: string; /** Links to Location */ rival?: string; /** Links to Location */ partner?: string; customs?: string; infrastructure?: string; architecture?: string; defensibility?: string; elevation?: string; /** Links to Collective */ populations?: string[]; /** Links to Institution */ secondary_powers?: string[]; /** Links to Character */ founders?: string[]; /** Links to Construct */ cults?: string[]; /** Links to Species */ delicacies?: string[]; /** Links to Construct */ extraction_methods?: string[]; /** Links to Construct */ extraction_goods?: string[]; /** Links to Construct */ industry_methods?: string[]; /** Links to Construct */ industry_goods?: string[]; /** Links to Location */ extraction_markets?: string[]; /** Links to Location */ industry_markets?: string[]; /** Links to Construct */ currencies?: string[]; /** Links to Object */ buildings?: string[]; /** Links to Construct */ building_methods?: string[]; /** Links to Construct */ fighters?: string[]; /** Links to Object */ defensive_objects?: string[]; } /** * Phenomenon element type */ interface Phenomenon extends BaseElement { expression?: string; effects?: string; duration?: string; mythology?: string; /** Links to Phenomenon */ system?: string; /** Links to Object */ catalysts?: string[]; /** Links to Ability */ empowerments?: string[]; /** Links to Construct */ triggers?: string[]; /** Links to Character */ wielders?: string[]; /** Links to Location */ environments?: string[]; } /** * Relation element type */ interface Relation extends BaseElement { background?: string; start_date?: string; end_date?: string; intensity?: string; /** Links to Character */ actor?: string; /** Links to Character */ characters?: string[]; /** Links to Object */ objects?: string[]; /** Links to Location */ locations?: string[]; /** Links to Species */ species?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Collective */ collectives?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Language */ languages?: string[]; /** Links to Family */ families?: string[]; /** Links to Title */ titles?: string[]; /** Links to Construct */ constructs?: string[]; /** Links to Event */ events?: string[]; /** Links to Narrative */ narratives?: string[]; } /** * Species element type */ interface Species extends BaseElement { appearance?: string; life_span?: string; weight?: string; instincts?: string; sociality?: string; temperament?: string; communication?: string; aggression?: string; role?: string; /** Links to Species */ parent_species?: string; /** Links to Species */ nourishment?: string[]; /** Links to Construct */ reproduction?: string[]; /** Links to Ability */ adaptations?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Location */ locations?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Phenomenon */ affinities?: string[]; } /** * Zone element type */ interface Zone extends BaseElement { role?: string; start_date?: string; end_date?: string; context?: string; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Zone */ linked_zones?: string[]; /** Links to Collective */ populations?: string[]; /** Links to Title */ titles?: string[]; /** Links to Construct */ principles?: string[]; } /** * Title element type */ interface Title extends BaseElement { authority?: string; eligibility?: string; grant_date?: string; revoke_date?: string; /** Links to Institution */ issuer?: string; /** Links to Institution */ body?: string; /** Links to Title */ superior_title?: string; status?: string; history?: string; /** Links to Character */ holders?: string[]; /** Links to Object */ symbols?: string[]; /** Links to Character */ characters?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Family */ families?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Location */ locations?: string[]; /** Links to Object */ objects?: string[]; /** Links to Construct */ constructs?: string[]; /** Links to Law */ laws?: string[]; /** Links to Collective */ collectives?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Species */ species?: string[]; /** Links to Language */ languages?: string[]; } /** * Trait element type */ interface Trait extends BaseElement { social_effects?: string; physical_effects?: string; functional_effects?: string; personality_effects?: string; behaviour_effects?: string; charisma?: string; coercion?: string; competence?: string; compassion?: string; creativity?: string; courage?: string; significance?: string; /** Links to Trait */ anti_trait?: string; /** Links to Ability */ empowered_abilities?: string[]; } /** * Narrative element type */ interface Narrative extends BaseElement { story?: string; consequences?: string; start_date?: string; end_date?: string; order?: string; /** Links to Narrative */ parent_narrative?: string; /** Links to Character */ protagonist?: string; /** Links to Character */ antagonist?: string; /** Links to Character */ narrator?: string; /** Links to Institution */ conservator?: string; /** Links to Event */ events?: string[]; /** Links to Character */ characters?: string[]; /** Links to Object */ objects?: string[]; /** Links to Location */ locations?: string[]; /** Links to Species */ species?: string[]; /** Links to Creature */ creatures?: string[]; /** Links to Institution */ institutions?: string[]; /** Links to Trait */ traits?: string[]; /** Links to Collective */ collectives?: string[]; /** Links to Zone */ zones?: string[]; /** Links to Ability */ abilities?: string[]; /** Links to Phenomenon */ phenomena?: string[]; /** Links to Language */ languages?: string[]; /** Links to Family */ families?: string[]; /** Links to Relation */ relations?: string[]; /** Links to Title */ titles?: string[]; /** Links to Construct */ constructs?: string[]; /** Links to Law */ laws?: string[]; } /** * Map element type */ interface Map extends BaseElement { background_color?: string; hierarchy?: string; width?: string; height?: string; depth?: string; /** Links to Map */ parent_map?: string; /** Links to Location */ location?: string; } /** * Marker element type */ interface Marker extends BaseElement { /** Links to Map */ map?: string; /** Links to Zone */ zone?: string; x?: string; y?: string; z?: string; } /** * Pin element type */ interface Pin extends BaseElement { /** Links to Map */ map?: string; /** Links to ContentType */ element_type?: string; x?: string; y?: string; z?: string; } /** * Input types for API requests (using _id and _ids suffixes) */ interface AbilityInput extends Omit<Ability, 'tradition' | 'source' | 'locus' | 'effects' | 'talents' | 'requisites' | 'instruments' | 'systems'> { tradition_id?: string; source_id?: string; locus_id?: string; effects_ids?: string[]; talents_ids?: string[]; requisites_ids?: string[]; instruments_ids?: string[]; systems_ids?: string[]; } interface ObjectInput extends Omit<Object$1, 'parent_object' | 'location' | 'language' | 'materials' | 'technology' | 'effects' | 'abilities' | 'consumes' | 'affinities'> { parent_object_id?: string; location_id?: string; language_id?: string; materials_ids?: string[]; technology_ids?: string[]; effects_ids?: string[]; abilities_ids?: string[]; consumes_ids?: string[]; affinities_ids?: string[]; } interface CharacterInput extends Omit<Character, 'birthplace' | 'location' | 'species' | 'traits' | 'abilities' | 'languages' | 'objects' | 'institutions' | 'family' | 'friends' | 'rivals'> { birthplace_id?: string; location_id?: string; species_ids?: string[]; traits_ids?: string[]; abilities_ids?: string[]; languages_ids?: string[]; objects_ids?: string[]; institutions_ids?: string[]; family_ids?: string[]; friends_ids?: string[]; rivals_ids?: string[]; } interface CollectiveInput extends Omit<Collective, 'operator' | 'equipment' | 'abilities' | 'symbolism' | 'species' | 'characters' | 'creatures' | 'phenomena'> { operator_id?: string; equipment_ids?: string[]; abilities_ids?: string[]; symbolism_ids?: string[]; species_ids?: string[]; characters_ids?: string[]; creatures_ids?: string[]; phenomena_ids?: string[]; } interface ConstructInput extends Omit<Construct, 'founder' | 'custodian' | 'characters' | 'objects' | 'locations' | 'species' | 'creatures' | 'institutions' | 'traits' | 'collectives' | 'zones' | 'abilities' | 'phenomena' | 'languages' | 'families' | 'relations' | 'titles' | 'constructs' | 'events' | 'narratives'> { founder_id?: string; custodian_id?: string; characters_ids?: string[]; objects_ids?: string[]; locations_ids?: string[]; species_ids?: string[]; creatures_ids?: string[]; institutions_ids?: string[]; traits_ids?: string[]; collectives_ids?: string[]; zones_ids?: string[]; abilities_ids?: string[]; phenomena_ids?: string[]; languages_ids?: string[]; families_ids?: string[]; relations_ids?: string[]; titles_ids?: string[]; constructs_ids?: string[]; events_ids?: string[]; narratives_ids?: string[]; } interface CreatureInput extends Omit<Creature, 'location' | 'zone' | 'species' | 'traits' | 'abilities' | 'languages' | 'actions'> { location_id?: string; zone_id?: string; species_ids?: string[]; traits_ids?: string[]; abilities_ids?: string[]; languages_ids?: string[]; actions_ids?: string[]; } interface EventInput extends Omit<Event, 'triggers' | 'characters' | 'objects' | 'locations' | 'species' | 'creatures' | 'institutions' | 'traits' | 'collectives' | 'zones' | 'abilities' | 'phenomena' | 'languages' | 'families' | 'relations' | 'titles' | 'constructs'> { triggers_ids?: string[]; characters_ids?: string[]; objects_ids?: string[]; locations_ids?: string[]; species_ids?: string[]; creatures_ids?: string[]; institutions_ids?: string[]; traits_ids?: string[]; collectives_ids?: string[]; zones_ids?: string[]; abilities_ids?: string[]; phenomena_ids?: string[]; languages_ids?: string[]; families_ids?: string[]; relations_ids?: string[]; titles_ids?: string[]; constructs_ids?: string[]; } interface FamilyInput extends Omit<Family, 'traditions' | 'traits' | 'abilities' | 'languages' | 'ancestors' | 'estates' | 'governs' | 'heirlooms' | 'creatures'> { traditions_ids?: string[]; traits_ids?: string[]; abilities_ids?: string[]; languages_ids?: string[]; ancestors_ids?: string[]; estates_ids?: string[]; governs_ids?: string[]; heirlooms_ids?: string[]; creatures_ids?: string[]; } interface InstitutionInput extends Omit<Institution, 'parent_institution' | 'zones' | 'objects' | 'creatures' | 'allies' | 'adversaries' | 'constructs'> { parent_institution_id?: string; zones_ids?: string[]; objects_ids?: string[]; creatures_ids?: string[]; allies_ids?: string[]; adversaries_ids?: string[]; constructs_ids?: string[]; } interface LanguageInput extends Omit<Language, 'classification' | 'spread' | 'dialects'> { classification_id?: string; spread_ids?: string[]; dialects_ids?: string[]; } interface LawInput extends Omit<Law, 'parent_law' | 'author' | 'penalties' | 'locations' | 'zones' | 'prohibitions' | 'adjudicators' | 'enforcers'> { parent_law_id?: string; author_id?: string; penalties_ids?: string[]; locations_ids?: string[]; zones_ids?: string[]; prohibitions_ids?: string[]; adjudicators_ids?: string[]; enforcers_ids?: string[]; } interface LocationInput extends Omit<Location, 'parent_location' | 'primary_power' | 'governing_title' | 'zone' | 'rival' | 'partner' | 'populations' | 'secondary_powers' | 'founders' | 'cults' | 'delicacies' | 'extraction_methods' | 'extraction_goods' | 'industry_methods' | 'industry_goods' | 'extraction_markets' | 'industry_markets' | 'currencies' | 'buildings' | 'building_methods' | 'fighters' | 'defensive_objects'> { parent_location_id?: string; primary_power_id?: string; governing_title_id?: string; zone_id?: string; rival_id?: string; partner_id?: string; populations_ids?: string[]; secondary_powers_ids?: string[]; founders_ids?: string[]; cults_ids?: string[]; delicacies_ids?: string[]; extraction_methods_ids?: string[]; extraction_goods_ids?: string[]; industry_methods_ids?: string[]; industry_goods_ids?: string[]; extraction_markets_ids?: string[]; industry_markets_ids?: string[]; currencies_ids?: string[]; buildings_ids?: string[]; building_methods_ids?: string[]; fighters_ids?: string[]; defensive_objects_ids?: string[]; } interface PhenomenonInput extends Omit<Phenomenon, 'system' | 'catalysts' | 'empowerments' | 'triggers' | 'wielders' | 'environments'> { system_id?: string; catalysts_ids?: string[]; empowerments_ids?: string[]; triggers_ids?: string[]; wielders_ids?: string[]; environments_ids?: string[]; } interface RelationInput extends Omit<Relation, 'actor' | 'characters' | 'objects' | 'locations' | 'species' | 'creatures' | 'institutions' | 'traits' | 'collectives' | 'zones' | 'abilities' | 'phenomena' | 'languages' | 'families' | 'titles' | 'constructs' | 'events' | 'narratives'> { actor_id?: string; characters_ids?: string[]; objects_ids?: string[]; locations_ids?: string[]; species_ids?: string[]; creatures_ids?: string[]; institutions_ids?: string[]; traits_ids?: string[]; collectives_ids?: string[]; zones_ids?: string[]; abilities_ids?: string[]; phenomena_ids?: string[]; languages_ids?: string[]; families_ids?: string[]; titles_ids?: string[]; constructs_ids?: string[]; events_ids?: string[]; narratives_ids?: string[]; } interface SpeciesInput extends Omit<Species, 'parent_species' | 'nourishment' | 'reproduction' | 'adaptations' | 'traits' | 'locations' | 'zones' | 'affinities'> { parent_species_id?: string; nourishment_ids?: string[]; reproduction_ids?: string[]; adaptations_ids?: string[]; traits_ids?: string[]; locations_ids?: string[]; zones_ids?: string[]; affinities_ids?: string[]; } interface ZoneInput extends Omit<Zone, 'phenomena' | 'linked_zones' | 'populations' | 'titles' | 'principles'> { phenomena_ids?: string[]; linked_zones_ids?: string[]; populations_ids?: string[]; titles_ids?: string[]; principles_ids?: string[]; } interface TitleInput extends Omit<Title, 'issuer' | 'body' | 'superior_title' | 'holders' | 'symbols' | 'characters' | 'institutions' | 'families' | 'zones' | 'locations' | 'objects' | 'constructs' | 'laws' | 'collectives' | 'creatures' | 'phenomena' | 'species' | 'languages'> { issuer_id?: string; body_id?: string; superior_title_id?: string; holders_ids?: string[]; symbols_ids?: string[]; characters_ids?: string[]; institutions_ids?: string[]; families_ids?: string[]; zones_ids?: string[]; locations_ids?: string[]; objects_ids?: string[]; constructs_ids?: string[]; laws_ids?: string[]; collectives_ids?: string[]; creatures_ids?: string[]; phenomena_ids?: string[]; species_ids?: string[]; languages_ids?: string[]; } interface TraitInput extends Omit<Trait, 'anti_trait' | 'empowered_abilities'> { anti_trait_id?: string; empowered_abilities_ids?: string[]; } interface NarrativeInput extends Omit<Narrative, 'parent_narrative' | 'protagonist' | 'antagonist' | 'narrator' | 'conservator' | 'events' | 'characters' | 'objects' | 'locations' | 'species' | 'creatures' | 'institutions' | 'traits' | 'collectives' | 'zones' | 'abilities' | 'phenomena' | 'languages' | 'families' | 'relations' | 'titles' | 'constructs' | 'laws'> { parent_narrative_id?: string; protagonist_id?: string; antagonist_id?: string; narrator_id?: string; conservator_id?: string; events_ids?: string[]; characters_ids?: string[]; objects_ids?: string[]; locations_ids?: string[]; species_ids?: string[]; creatures_ids?: string[]; institutions_ids?: string[]; traits_ids?: string[]; collectives_ids?: string[]; zones_ids?: string[]; abilities_ids?: string[]; phenomena_ids?: string[]; languages_ids?: string[]; families_ids?: string[]; relations_ids?: string[]; titles_ids?: string[]; constructs_ids?: string[]; laws_ids?: string[]; } interface MapInput extends Omit<Map, 'parent_map' | 'location'> { parent_map_id?: string; location_id?: string; } interface MarkerInput extends Omit<Marker, 'map' | 'zone'> { map_id?: string; zone_id?: string; } interface PinInput extends Omit<Pin, 'map' | 'element_type'> { map_id?: string; element_type_id?: string; } /** * All available element types in OnlyWorlds */ declare enum ElementType { Ability = "ability", Character = "character", Collective = "collective", Construct = "construct", Creature = "creature", Event = "event", Family = "family", Institution = "institution", Language = "language", Law = "law", Location = "location", Map = "map", Marker = "marker", Narrative = "narrative", Object = "object", Phenomenon = "phenomenon", Pin = "pin", Relation = "relation", Species = "species", Title = "title", Trait = "trait", Zone = "zone" } interface OnlyWorldsConfig { apiKey: string; apiPin: string; baseUrl?: string; } interface ListOptions { limit?: number; offset?: number; ordering?: string; search?: string; [key: string]: any; } interface ApiResponse<T> { count: number; next: string | null; previous: string | null; results: T[]; } /** * Base resource class for CRUD operations */ declare class Resource<T, TInput> { private client; private elementType; constructor(client: OnlyWorldsClient, elementType: string); list(options?: ListOptions): Promise<ApiResponse<T>>; get(id: string): Promise<T>; create(data: TInput): Promise<T>; update(id: string, data: Partial<TInput>): Promise<T>; delete(id: string): Promise<void>; } /** * Main OnlyWorlds API client */ declare class OnlyWorldsClient { private baseUrl; private headers; worlds: Resource<World, WorldInput>; abilities: Resource<Ability, AbilityInput>; characters: Resource<Character, CharacterInput>; collectives: Resource<Collective, CollectiveInput>; constructs: Resource<Construct, ConstructInput>; creatures: Resource<Creature, CreatureInput>; events: Resource<Event, EventInput>; families: Resource<Family, FamilyInput>; institutions: Resource<Institution, InstitutionInput>; languages: Resource<Language, LanguageInput>; laws: Resource<Law, LawInput>; locations: Resource<Location, LocationInput>; maps: Resource<Map, MapInput>; markers: Resource<Marker, MarkerInput>; narratives: Resource<Narrative, NarrativeInput>; objects: Resource<Object$1, ObjectInput>; phenomena: Resource<Phenomenon, PhenomenonInput>; pins: Resource<Pin, PinInput>; relations: Resource<Relation, RelationInput>; species: Resource<Species, SpeciesInput>; titles: Resource<Title, TitleInput>; traits: Resource<Trait, TraitInput>; zones: Resource<Zone, ZoneInput>; constructor(config: OnlyWorldsConfig); /** * Make a request to the OnlyWorlds API */ request<T>(method: string, path: string, options?: { params?: Record<string, any>; body?: any; }): Promise<T>; /** * Get all worlds accessible with current credentials * @deprecated Use client.worlds.list() instead for consistent API */ getWorlds(): Promise<ApiResponse<World>>; /** * Helper to convert nested objects to _id/_ids format */ static prepareInput<T extends Record<string, any>>(data: T): any; } export { type Ability, type AbilityInput, type ApiResponse, type BaseElement, type Character, type CharacterInput, type Collective, type CollectiveInput, type Construct, type ConstructInput, type Creature, type CreatureInput, ElementType, type Event, type EventInput, type Family, type FamilyInput, type Institution, type InstitutionInput, type Language, type LanguageInput, type Law, type LawInput, type ListOptions, type Location, type LocationInput, type Map, type MapInput, type Marker, type MarkerInput, type Narrative, type NarrativeInput, type Object$1 as Object, type ObjectInput, OnlyWorldsClient, type OnlyWorldsConfig, type Phenomenon, type PhenomenonInput, type Pin, type PinInput, type Relation, type RelationInput, type Species, type SpeciesInput, type Title, type TitleInput, type Trait, type TraitInput, type World, type WorldInput, type Zone, type ZoneInput };