import { IGunChain2TNode } from '../types/utils.d'; import { GunCallbackOn, GunDataNode, GunMessagePut, GunOptionsOn, GunOptionsOnce, GunOptionsPut, IGunChain, GunSchema, GunSoul, } from '../types/gun'; import {} from '../types/gun/IGunInstance'; declare module '../types/gun/IGunInstance' { export interface IGunInstance { /** * @param value the data to save * @param options `put` options */ promPut>( value: V, options: GunOptionsPut ): Promise<{ ref: IGunChain, IGunInstance, ''>; ack: GunMessagePut; }>; } } import {} from '../types/gun/IGunChain'; declare module '../types/gun/IGunChain' { export interface IGunChain { /** * @param value the data to save * @param options `put` options */ promPut< V extends | (TNode extends object ? Partial : TNode) | GunSoul | IGunChain | IGunChain, any, any, any> >( value: V, options: GunOptionsPut ): Promise<{ ref: IGunChain; ack: GunMessagePut; }>; /** * @param value the data to save * @param options `put` options */ promSet< V extends Partial | GunSoul | IGunChain, K extends keyof TNode & string, N extends TNode[K] & Record >( value: V, options: GunOptionsPut ): Promise<{ ref: V extends GunSchema ? IGunChain< N, IGunChain, TGunInstance, K > : IGunChain< IGunChain2TNode, IGunChain, TGunInstance, K >; ack: GunMessagePut; }>; /** * @param callback function to be called upon changes to data * @param options `put` options */ promOn( callback: GunCallbackOn, options: GunOptionsOn ): Promise>; /** * @param limit due to promises resolving too fast if we do not set a timer we will not be * able receive any data back from gun before returning the promise works both following a * `Chain.get` and a `Chain.map` (limit only applies to map). If no limit is chosen, * defaults to 100 ms (quite sufficient to fetch about 2000 nodes or more) * @param options `once` options */ promOnce( limit: number, options: GunOptionsOnce ): Promise<{ ref: IGunChain; data: GunDataNode; key: keyof IGunChain2TNode & string; }>; } }