UNPKG

wiki-entity

Version:
69 lines (68 loc) 2.08 kB
export declare type PlainObject<T> = { [index: string]: T; }; export declare type AnyPlainObject = PlainObject<any>; export declare type StringPlainObject = PlainObject<string>; export interface WikidataPropertyValue { datatype: string; value: any; pageid?: number; value_string?: string; label?: string; description?: string; qualifiers?: WikidataEntityClaims | null; } export interface WikidataBaseEntity { id: string; label?: string; description?: string; [index: string]: any; } export interface WikidataProperty extends WikidataBaseEntity { values: WikidataPropertyValue[]; } export declare type WikidataEntityClaims = PlainObject<WikidataProperty>; export interface WikidataEntity extends WikidataBaseEntity { pageid?: number; aliases?: string[]; sitelinks?: PlainObject<string>; claims?: WikidataEntityClaims; labels?: PlainObject<string>; } export declare type WikidataEntities = PlainObject<WikidataEntity>; export interface WikiEntity extends WikidataEntity { extract?: string; types?: string[]; redirects?: string[]; categories?: string[]; redirectsToId?: string; redirectsFromId?: string; } export declare type WikiEntities = PlainObject<WikiEntity>; export declare type ParamClaimsType = "none" | "all" | "item" | "property"; export interface WikidataEntitiesParams { ids?: string[]; titles?: string[]; props?: WikidataPropsParam[]; language?: string; redirect?: string; claims?: ParamClaimsType; httpTimeout?: number; languages?: string[]; } export declare enum WikidataPropsParam { info = "info", sitelinks = "sitelinks", aliases = "aliases", labels = "labels", descriptions = "descriptions", claims = "claims", datatype = "datatype" } export interface WikiEntitiesParams extends WikidataEntitiesParams { extract?: number; types?: boolean | string[]; redirects?: boolean; categories?: boolean; wikiPageId?: boolean; }