You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
* A function to be called when the SQLite3 module and worker APIs are done
1769
+
* loading asynchronously. This is the only way of knowing that the loading
1770
+
* has completed.
1771
+
*
1772
+
*@since V3.46: Is passed the function which gets returned by
1773
+
* `sqlite3Worker1Promiser()`, as accessing it from this callback is more
1774
+
* convenient for certain usage patterns. The promiser v2 interface obviates
1775
+
* the need for this callback.
1776
+
*/
1777
+
typeOnreadyFunction=()=>void;
1778
+
1779
+
typeSqlite3Worker1PromiserConfig={
1780
+
onready?:OnreadyFunction;
1781
+
/**
1782
+
* A worker instance which loads `sqlite3-worker1.js`, or a functional
1783
+
* equivalent. Note that the promiser factory replaces the
1784
+
* `worker.onmessage` property. This config option may alternately be a
1785
+
* function, in which case this function is called to instantiate the
1786
+
* worker.
1787
+
*/
1788
+
worker?:Worker|(()=>Worker);
1789
+
/** Function to generate unique message IDs */
1790
+
generateMessageId?:(messageObject:TODO)=>string;
1791
+
/**
1792
+
* A `console.debug()` style function for logging information about Worker
1793
+
* messages.
1794
+
*/
1795
+
debug?:(...args:any[])=>void;
1796
+
/**
1797
+
* A callback function that is called when a `message` event is received
1798
+
* from the worker, and the event is not handled by the proxy.
1799
+
*
1800
+
*@note This *should* ideally never happen, as the proxy aims to handle
1801
+
* all known message types.
1802
+
*/
1803
+
onunhandled?:(event:MessageEvent)=>void;
1804
+
};
1805
+
1806
+
/**
1807
+
* A db identifier string (returned by 'open') which tells the operation which
1808
+
* database instance to work on. If not provided, the first-opened db is
1809
+
* used.
1810
+
*
1811
+
*@warning This is an "opaque" value, with no inherently useful syntax
1812
+
* or information. Its value is subject to change with any given build
1813
+
* of this API and cannot be used as a basis for anything useful beyond
1814
+
* its one intended purpose.
1815
+
*/
1816
+
typeDbId=string|undefined;
1817
+
typeSqlite3Version={
1818
+
libVersion:string;
1819
+
sourceId:string;
1820
+
libVersionNumber:number;
1821
+
downloadVersion:number;
1822
+
};
1823
+
1824
+
// Message types and their corresponding arguments and results. Should be able to get better types for some of these (open, exec and stack) from the existing types, although the Promiser verions have minor differences