Skip to content

KeptFiles beta ​

Class of @v12-engine/client

ts
export declare class KeptFiles

Keeping a game's files between visits (S42): its models and sounds are kept by the browser (the Cache API) by their address, under a version (GameView.files.keepFiles), and taken from there the next time, with nothing asked of the network. A new version starts over, and the files of the one before are let go. Nothing kept where the page has no Cache API (served over plain http other than localhost, or a browser that has none)

Members ​

constructor ​

ts
constructor(
    version: string, load?: (url: string) => Promise<Response>);

Constructs a new instance of the KeptFiles class

fetch ​

ts
fetch(url: string): Promise<Response>;

A file, from what is kept when it is, from the network otherwise (and kept). What is no address of the network is fetched as it is

has ​

ts
has(url: string): Promise<boolean>;

Whether a file is kept now

version ​

ts
readonly version: string;

What is kept is of this version: a new one, and it is fetched again