Skip to content

Commit

Permalink
fix: export SQLiteProvider type
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Nov 26, 2024
1 parent cd59903 commit 3b624bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type {Connection} from './OnyxConnectionManager';
import useOnyx from './useOnyx';
import withOnyx from './withOnyx';
import type {WithOnyxState} from './withOnyx/types';
import type {OnyxSQLiteKeyValuePair} from './storage/providers/SQLiteProvider';

export default Onyx;
export {useOnyx, withOnyx};
Expand All @@ -48,4 +49,5 @@ export type {
UseOnyxResult,
WithOnyxState,
Connection,
OnyxSQLiteKeyValuePair,
};
11 changes: 11 additions & 0 deletions lib/storage/providers/SQLiteProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@ import type StorageProvider from './types';
import utils from '../../utils';
import type {KeyList, KeyValuePairList} from './types';

/**
* The type of the key-value pair stored in the SQLite database
* @property record_key - the key of the record
* @property valueJSON - the value of the record in JSON string format
*/
type OnyxSQLiteKeyValuePair = {
record_key: string;
valueJSON: string;
};

/**
* The result of the `PRAGMA page_size`, which gets the page size of the SQLite database
*/
type PageSizeResult = {
page_size: number;
};

/**
* The result of the `PRAGMA page_count`, which gets the page count of the SQLite database
*/
type PageCountResult = {
page_count: number;
};
Expand Down

0 comments on commit 3b624bb

Please sign in to comment.