capacitor-cblite
v2.8.5
Published
Add native CBLite support to Capacitor apps
Readme
capacitor-cblite
Add native CBLite support to Capacitor apps
Install
npm install capacitor-cblite
npx cap syncAPI
open(...)close(...)sync(...)updateSessionID(...)stopSync(...)destroy(...)get(...)put(...)remove(...)indexes(...)createIndex(...)registerScript(...)query(...)addListener(...)addListener(...)- Interfaces
open(...)
open(options: CallOptions) => any| Param | Type |
| ------------- | --------------------------------------------------- |
| options | CallOptions |
Returns: any
close(...)
close(options: CallOptions) => any| Param | Type |
| ------------- | --------------------------------------------------- |
| options | CallOptions |
Returns: any
sync(...)
sync(options: ReplicationOptions) => any| Param | Type |
| ------------- | ----------------------------------------------------------------- |
| options | ReplicationOptions |
Returns: any
updateSessionID(...)
updateSessionID(options: any) => any| Param | Type |
| ------------- | ---------------- |
| options | any |
Returns: any
stopSync(...)
stopSync(options: CallOptions) => any| Param | Type |
| ------------- | --------------------------------------------------- |
| options | CallOptions |
Returns: any
destroy(...)
destroy(options: CallOptions) => any| Param | Type |
| ------------- | --------------------------------------------------- |
| options | CallOptions |
Returns: any
get(...)
get<T>(options: CallOptions & DatabaseRecord) => any| Param | Type |
| ------------- | -------------------------------------------------------------------------------------------------- |
| options | CallOptions & DatabaseRecord |
Returns: any
put(...)
put<T>(options: CallOptions & { doc: DatabaseRecord & T; }) => any| Param | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------------- |
| options | CallOptions & { doc: DatabaseRecord & T; } |
Returns: any
remove(...)
remove(options: CallOptions & DatabaseRecord) => any| Param | Type |
| ------------- | -------------------------------------------------------------------------------------------------- |
| options | CallOptions & DatabaseRecord |
Returns: any
indexes(...)
indexes(options: CallOptions) => any| Param | Type |
| ------------- | --------------------------------------------------- |
| options | CallOptions |
Returns: any
createIndex(...)
createIndex(options: CallOptions & { index: IndexRequest; }) => any| Param | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------- |
| options | CallOptions & { index: IndexRequest; } |
Returns: any
registerScript(...)
registerScript(options: { label: string; script: string; }) => any| Param | Type |
| ------------- | ----------------------------------------------- |
| options | { label: string; script: string; } |
Returns: any
query(...)
query<T = unknown>(options: CallOptions & QueryOptions<T>) => any| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| options | CallOptions & QueryOptions<T> |
Returns: any
addListener(...)
addListener(event: 'cblite:repl', listener: (data: ReplEvent) => void) => any| Param | Type |
| -------------- | ------------------------------------------------------------------ |
| event | "cblite:repl" |
| listener | (data: ReplEvent) => void |
Returns: any
addListener(...)
addListener(event: 'cblite:change', listener: (data: ChangeEvent) => void) => any| Param | Type |
| -------------- | ---------------------------------------------------------------------- |
| event | "cblite:change" |
| listener | (data: ChangeEvent) => void |
Returns: any
Interfaces
CallOptions
| Prop | Type |
| ---------- | ------------------- |
| name | string |
ReplicationOptions
| Prop | Type |
| --------------- | ------------------- |
| host | string |
| sessionId | string |
DatabaseRecord
| Prop | Type |
| ---------- | ------------------- |
| _id | string |
| _rev | string |
IndexRequest
| Prop | Type |
| ------------ | ------------------- |
| fields | {} |
| name | string |
IndexResult
| Prop | Type |
| ------------ | ---------------------------------- |
| result | "created" | "exists" |
| name | string |
QueryOptions
| Prop | Type |
| -------------- | ------------------------------------------------- |
| query | string | Query |
| callback | string | Callback<T> |
Query
| Prop | Type |
| -------------- | ------------------- |
| what | {} |
| where | {} |
| group_by | {} |
| order_by | {} |
| limit | number |
| offset | number |
QueryResult
| Prop | Type |
| ------------------- | ------------------- |
| rows | {} |
| executionTime | number |
| totalTime | number |
| totalCount | number |
| finalCount | number |
ReplEvent
| Prop | Type |
| --------------- | ------------------- |
| name | string |
| completed | number |
| total | number |
| error | string |
| status | number |
| event | string |
ChangeEvent
| Prop | Type |
| ---------- | ------------------- |
| name | string |
| doc | any |
