webextension-store-meta
Version:
Get browser extension(webextension) item meta from Chrome Web Store and Firefox add-ons.
57 lines (56 loc) • 1.57 kB
TypeScript
import type { RequestInit } from "undici";
import { type Node } from "domhandler";
export type { RequestInit };
export interface ChromeWebStoreMeta {
name: string | null;
description: string | null;
url: string | null;
image: string | null;
ratingValue: string | null;
ratingCount: string | null;
users: string | null;
version: string | null;
size: string | null;
lastUpdated: string | null;
}
export interface ChromeWebStoreOptions {
/**
* Chrome Web Store extension ID
* @example "cdonnmffkdaoajfknoeeecmchibpmkmg"
*/
id: string;
/**
* `undici.fetch` options
* @see {@link https://undici.nodejs.org/#/?id=undicifetchinput-init-promise}
*/
options?: RequestInit;
/**
* Query string
*/
qs?: Record<string, string> | string;
}
export declare class ChromeWebStore {
id: string;
options?: RequestInit;
qs: string;
private _dom;
private _cache;
constructor({ id, options, qs }: ChromeWebStoreOptions);
static load(options: ChromeWebStoreOptions): Promise<ChromeWebStore>;
load(): Promise<ChromeWebStore>;
meta(): ChromeWebStoreMeta;
name(): string | null;
description(): string | null;
url(): string | null;
image(): string | null;
ratingValue(): string | null;
ratingCount(): string | null;
users(): string | null;
version(): string | null;
size(): string | null;
lastUpdated(): string | null;
get dom(): Node[];
private _og;
private _parseRating;
}
export default ChromeWebStore;