@trivia-api/fetch
Version:
Functions to fetch data from The Trivia API.
14 lines (13 loc) • 664 B
TypeScript
import { V2Question } from "@trivia-api/client";
type RequiredProperties = Required<Pick<V2Question, "category" | "correctAnswer" | "question">>;
type OptionalProperties = Partial<Pick<V2Question, "difficulty" | "regions" | "type" | "tags">>;
export type SubmittableQuestion = RequiredProperties | OptionalProperties;
/**
* Submits a question to the trivia api
* @param key - API Key
* @param question - Question to submit
* @param host - Optional host to send request to
* @returns the ID of the newly created question
*/
export declare const submitQuestion: (key: string | null, question: SubmittableQuestion, host?: string) => Promise<string>;
export {};