Runtime & Language
TypeScript
ytsearch.js ships TypeScript declarations for its public functions, result objects, options and errors.
The generated declaration file exports interfaces and types directly from the package. This means editors can provide completion and compile-time checking without a separate @types package.
ts
import {
searchYouTube,
SearchOptions,
SearchResult,
YtSearchError,
} from "ytsearch.js";Browse the complete type reference for every exported type in v2.1.3.