リファレンス · データの入口(自分で用意した星やディープスカイ天体を、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)
TileStore型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A tile store: tiles by source and key, under one byte budget.
インポート
import type { TileStore } from "@johnmorrisdotca/hoshi-stars/door";
定義
interface TileStore<Tile> {
want(source: TileLoader<Tile>, keys: readonly string[], again?: boolean): ReadonlyMap<string, Tile>;
get(sourceId: string, key: string): Tile | undefined;
drop(sourceId: string): void;
stats(): TileStats;
idle(): Promise<void>;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
want | (source: TileLoader<Tile>, keys: readonly string[], again?: boolean): ReadonlyMap<string, Tile> | Tells the store which tiles |
get | (sourceId: string, key: string): Tile | undefined | One held tile, or |
drop | (sourceId: string): void | Forgets a source: aborts its loads, frees its tiles. The source is switched off. |
stats | (): TileStats | |
idle | (): Promise<void> | Resolves when no load is running or waiting. |
例
import type { TileStore } from "./data-door.ts";
const held = (store: TileStore<Uint8Array>): number => store.stats().held;この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。