gun/types/static.d.ts
Bernie Telles 70eb769209
Add TypeScript test file & tsd as devDep to run it (#1091)
This helps those who want to contribute to the TypeScript definitions
by adding:
 * a tool called `tsd,`
 * its corresponding configuration in package.json
 * a teste file index.test-d.ts

Also add a extra line between type definitions to improve readability.
2021-07-27 13:02:47 -07:00

29 lines
1.1 KiB
TypeScript

import { IGunChainReference } from './chain';
import { IGunConstructorOptions } from './options';
import { IGunStaticNode } from './static/node';
import { IGunStaticSEA } from './static/sea';
export interface IGunStatic {
/**
* @description
* no parameters creates a local datastore using the default persistence layer, either localStorage or Radisk.
* @param options
* passing a URL creates the above local datastore that also tries to sync with the URL.
*
* or you can pass in an array of URLs to sync with multiple peers.
*/
<DataType = any>(options?: string | string[] | IGunConstructorOptions): IGunChainReference<DataType, any, 'pre_root'>;
new <DataType = any>(options?: string | string[] | IGunConstructorOptions): IGunChainReference<DataType, any, 'pre_root'>;
readonly node: IGunStaticNode;
/** @see https://gun.eco/docs/SEA */
readonly SEA: IGunStaticSEA;
readonly version: string;
readonly chain: IGunChainReference;
readonly log: {
(...argv: any[]): void;
once(...argv: any[]): void;
off: boolean;
};
}