1.39.0 • Published 1 year ago
@trivia-api/models v1.39.0
Trivia API Models
Typescript models and guards for types used in The Trivia API.
Usage
Install the models with npm install @trivia-api/models
, and use within Typescript files:
import { type Question } from "@trivia-api/models";
// The Typescript compiler will complain because there is no `incorrectAnswers` property
const invalidQuestion: Question = {
question: "What is the capital of France?",
correctAnswer: "Paris",
category: "Geography",
tags: ["france", "capital_cities", "europe"],
type: "Multiple Choice",
difficulty: "easy",
id: "abcde-fg",
};
// The compiler will be happy because this is a valid instance of Question - all required properties are present.
const validQuestion: Question = {
question: "What is the capital of France?",
correctAnswer: "Paris",
incorrectAnswers: ["Lyon", "Marseilles", "Bordeaux"],
category: "Geography",
tags: ["france", "capital_cities", "europe"],
type: "Multiple Choice",
difficulty: "easy",
id: "abcde-fg",
};
1.39.0
1 year ago
1.36.0
2 years ago
1.34.0
2 years ago
1.29.0
2 years ago
1.28.0
2 years ago
1.32.0
2 years ago
1.33.0
2 years ago
1.30.0
2 years ago
1.25.0
2 years ago
1.26.0
2 years ago
1.27.0
2 years ago
1.19.0
2 years ago
1.18.0
2 years ago
1.21.0
2 years ago
1.20.0
2 years ago
1.17.0
2 years ago
1.9.0
3 years ago
1.5.0
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.5-1
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago