npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@recouch/couchbase-lite-capacitor

v0.2.7

Published

Couchbase Lite bindings for iOS and Android via Capacitor

Downloads

3

Readme

@recouch/couchbase-lite-capacitor

Couchbase Lite bindings for iOS and Android with Capacitor

Install

npm install @recouch/couchbase-lite-capacitor
npx cap sync

API

openDatabase(...)

openDatabase(options: { name: string; directory?: string; }) => Result<DatabaseRef>

| Param | Type | | ------------- | -------------------------------------------------- | | options | { name: string; directory?: string; } |

Returns: Result<Tagged<'Database'>>


addDatabaseChangeListener(...)

addDatabaseChangeListener(options: DatabaseRefOptions, handler: DatabaseChangeListener) => Result<ListenerToken>

| Param | Type | | ------------- | ------------------------------------------------------------------------- | | options | DatabaseRefOptions | | handler | DatabaseChangeListener |

Returns: Result<Tagged<'ListenerToken'>>


beginTransaction(...)

beginTransaction(options: DatabaseRefOptions) => Result<void>

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | DatabaseRefOptions |

Returns: Result<void>


closeDatabase(...)

closeDatabase(options: DatabaseRefOptions) => Result<void>

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | DatabaseRefOptions |

Returns: Result<void>


databaseName(...)

databaseName(options: DatabaseRefOptions) => Result<string>

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | DatabaseRefOptions |

Returns: Result<string>


databasePath(...)

databasePath(options: DatabaseRefOptions) => Result<string>

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | DatabaseRefOptions |

Returns: Result<string>


deleteDatabase(...)

deleteDatabase(options: { name: string; directory: string; }) => Result<void>

| Param | Type | | ------------- | ------------------------------------------------- | | options | { name: string; directory: string; } |

Returns: Result<void>


deleteDatabase(...)

deleteDatabase(options: DatabaseRefOptions) => Result<void>

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | DatabaseRefOptions |

Returns: Result<void>


endTransaction(...)

endTransaction(options: DatabaseRefOptions & { commit: boolean; }) => Result<void>

| Param | Type | | ------------- | ---------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { commit: boolean; } |

Returns: Result<void>


removeDatabaseChangeListener(...)

removeDatabaseChangeListener(options: { token: ListenerToken; }) => Result<void>

| Param | Type | | ------------- | --------------------------------------------------------------------------------------------------------- | | options | { token: Tagged<'ListenerToken'>; } |

Returns: Result<void>


addDocumentChangeListener(...)

addDocumentChangeListener(options: DatabaseRefOptions & { id: string; }, handler: DocumentChangeListener) => Result<ListenerToken>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; } | | handler | DocumentChangeListener |

Returns: Result<Tagged<'ListenerToken'>>


deleteDocument(...)

deleteDocument(options: DatabaseRefOptions & { id: string; }) => Result<void>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; } |

Returns: Result<void>


documentExists(...)

documentExists(options: DatabaseRefOptions & { id: string; }) => Result<boolean>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; } |

Returns: Result<boolean>


getDocument(...)

getDocument<T = object>(options: DatabaseRefOptions & { id: string; }) => Result<T | undefined>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; } |

Returns: Result<T>


saveDocument(...)

saveDocument<T = object>(options: DatabaseRefOptions & { id: string; value: T; }) => Result<void>

| Param | Type | | ------------- | --------------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; value: T; } |

Returns: Result<void>


createQuery(...)

createQuery<T = unknown, P = Record<string, string>>(options: DatabaseRefOptions & { query: string; }) => Result<QueryRef<T, P>>

| Param | Type | | ------------- | -------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { query: string; } |

Returns: Result<QueryRef<T, P>>


addQueryChangeListener(...)

addQueryChangeListener<T = unknown, P = Record<string, string>>(options: QueryRefOptions<T, P>, handler: QueryChangeListener<T>) => Result<ListenerToken>

| Param | Type | | ------------- | ---------------------------------------------------------------------------- | | options | QueryRefOptions<T, P> | | handler | QueryChangeListener<T> |

Returns: Result<Tagged<'ListenerToken'>>


executeQuery(...)

executeQuery<T = unknown, P = Record<string, string>>(options: QueryRefOptions<T, P>) => Result<T[]>

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | QueryRefOptions<T, P> |

Returns: Result<T[]>


explainQuery(...)

explainQuery<T = unknown, P = Record<string, string>>(options: QueryRefOptions<T, P>) => Result<string>

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | QueryRefOptions<T, P> |

Returns: Result<string>


getQueryParameters(...)

getQueryParameters<T = unknown, P = Record<string, string>>(options: QueryRefOptions<T, P>) => Result<Partial<P>>

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | QueryRefOptions<T, P> |

Returns: Result<Partial<P>>


removeQueryChangeListener(...)

removeQueryChangeListener(options: { token: ListenerToken; }) => Result<void>

| Param | Type | | ------------- | --------------------------------------------------------------------------------------------------------- | | options | { token: Tagged<'ListenerToken'>; } |

Returns: Result<void>


setQueryParameters(...)

setQueryParameters<T = unknown, P = Record<string, string>>(options: QueryRefOptions<T, P> & { parameters: Partial<P>; }) => Result<void>

| Param | Type | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | options | QueryRefOptions<T, P> & { parameters: Partial<P>; } |

Returns: Result<void>


addDocumentReplicationListener(...)

addDocumentReplicationListener(options: ReplicatorRefOptions, handler: DocumentReplicationListener) => Result<ListenerToken>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------- | | options | ReplicatorRefOptions | | handler | DocumentReplicationListener |

Returns: Result<Tagged<'ListenerToken'>>


addReplicatorChangeListener(...)

addReplicatorChangeListener(options: ReplicatorRefOptions, handler: ReplicatorChangeListener) => Result<ListenerToken>

| Param | Type | | ------------- | ----------------------------------------------------------------------------- | | options | ReplicatorRefOptions | | handler | ReplicatorChangeListener |

Returns: Result<Tagged<'ListenerToken'>>


createReplicator(...)

createReplicator(options: { config: ReplicatorConfiguration; }) => Result<ReplicatorRef>

| Param | Type | | ------------- | ---------------------------------------------------------------------------------------- | | options | { config: ReplicatorConfiguration; } |

Returns: Result<Tagged<'Replicator'>>


documentsPendingReplication(...)

documentsPendingReplication(options: ReplicatorRefOptions) => Result<string[]>

| Param | Type | | ------------- | --------------------------------------------------------------------- | | options | ReplicatorRefOptions |

Returns: Result<string[]>


isDocumentPendingReplication(...)

isDocumentPendingReplication(options: ReplicatorRefOptions & { documentID: string; }) => Result<boolean>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------------------- | | options | ReplicatorRefOptions & { documentID: string; } |

Returns: Result<boolean>


removeReplicatorListener(...)

removeReplicatorListener(options: { token: ListenerToken; }) => Result<void>

| Param | Type | | ------------- | --------------------------------------------------------------------------------------------------------- | | options | { token: Tagged<'ListenerToken'>; } |

Returns: Result<void>


replicatorConfiguration(...)

replicatorConfiguration(options: ReplicatorRefOptions) => Result<ReplicatorConfiguration>

| Param | Type | | ------------- | --------------------------------------------------------------------- | | options | ReplicatorRefOptions |

Returns: Result<ReplicatorConfiguration>


replicatorStatus(...)

replicatorStatus(options: ReplicatorRefOptions) => Result<ReplicatorStatus>

| Param | Type | | ------------- | --------------------------------------------------------------------- | | options | ReplicatorRefOptions |

Returns: Result<ReplicatorStatus>


setHostReachable(...)

setHostReachable(options: ReplicatorRefOptions & { reachable: boolean; }) => Result<void>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------------------- | | options | ReplicatorRefOptions & { reachable: boolean; } |

Returns: Result<void>


startReplicator(...)

startReplicator(options: ReplicatorRefOptions & { resetCheckpoint?: boolean; }) => Result<void>

| Param | Type | | ------------- | ------------------------------------------------------------------------------------------------------ | | options | ReplicatorRefOptions & { resetCheckpoint?: boolean; } |

Returns: Result<void>


stopReplicator(...)

stopReplicator(options: ReplicatorRefOptions) => Result<void>

| Param | Type | | ------------- | --------------------------------------------------------------------- | | options | ReplicatorRefOptions |

Returns: Result<void>


blobProperties(...)

blobProperties(options: BlobOptions) => Result<BlobMetadata>

| Param | Type | | ------------- | --------------------------------------------------- | | options | BlobOptions |

Returns: Result<BlobMetadata>


databaseGetBlob(...)

databaseGetBlob(options: { database: DatabaseRef; properties: BlobMetadata; }) => Result<string>

| Param | Type | | ------------- | -------------------------------------------------------------------------------------------------------------------------------- | | options | { database: Tagged<'Database'>; properties: BlobMetadata; } |

Returns: Result<string>


databaseSaveBlob(...)

databaseSaveBlob(options: BlobOptions & { database: DatabaseRef; }) => Result<void>

| Param | Type | | ------------- | ------------------------------------------------------------------------------------------------------------------- | | options | BlobOptions & { database: Tagged<'Database'>; } |

Returns: Result<void>


documentGetBlob(...)

documentGetBlob(options: DatabaseRefOptions & { id: string; property: string; }) => Result<string>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; property: string; } |

Returns: Result<string>


documentGetBlobProperties(...)

documentGetBlobProperties(options: DatabaseRefOptions & { id: string; property: string; }) => Result<BlobMetadata>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; property: string; } |

Returns: Result<BlobMetadata>


documentIsBlob(...)

documentIsBlob(options: DatabaseRefOptions & { id: string; property: string; }) => Result<boolean>

| Param | Type | | ------------- | ----------------------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & { id: string; property: string; } |

Returns: Result<boolean>


documentSaveBlob(...)

documentSaveBlob(options: DatabaseRefOptions & BlobOptions & { id: string; property: string; }) => Result<void>

| Param | Type | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | options | DatabaseRefOptions & BlobOptions & { id: string; property: string; } |

Returns: Result<void>


Interfaces

DatabaseRefOptions

| Prop | Type | | -------------- | --------------------------------------------------- | | database | DatabaseRef |

QueryRefOptions

| Prop | Type | | ----------- | --------------------------------------------------------- | | query | QueryRef<T, P> |

ReplicatorRefOptions

| Prop | Type | | ---------------- | ------------------------------------------------------- | | replicator | ReplicatorRef |

ReplicatorStatus

| Prop | Type | | -------------- | ----------------------------------------------------------------------- | | activity | 'stopped' | 'offline' | 'connecting' | 'idle' | 'busy' | | error | string | | progress | { complete: number; documentCount: number; } |

ReplicatorConfiguration

| Prop | Type | | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | | database | DatabaseRef | | endpoint | string | Tagged<'Database'> | | authenticator | { type: 'basic'; username: string; password: string; } | { type: 'session'; sessionID: string; cookieName?: string; } | | replicatorType | ReplicatorType | | continuous | boolean | | disableAutoPurge | boolean | | maxAttempts | number | | maxAttemptWaitTime | number | | heartbeat | number | | conflictResolver | ((document: { documentID: string; localDocument: object; remoteDocument: object; }) => void) | | pushFilter | ((document: { documentID: string; value: object; accessRemoved: boolean; deleted: boolean; }) => void) | | pullFilter | ((document: { documentID: string; value: object; accessRemoved: boolean; deleted: boolean; }) => void) |

BlobMetadata

| Prop | Type | | ------------------ | ------------------- | | '@type' | 'blob' | | content_type | string | | digest | string | | length | number |

BlobOptions

| Prop | Type | | ---------- | ------------------------------------------------- | | blob | BlobConfig |

Type Aliases

Result

Promise<T extends void ? void : { value: T }>

DatabaseRef

Opaque<unknown, 'Database'>

Opaque

Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly.

The generic type parameter can be anything. It doesn't have to be an object.

Read more about opaque types.

There have been several discussions about adding this feature to TypeScript via the opaque type operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward:

Type & Tagged<Token>

Tagged

{ readonly [tag]: Token; }

DatabaseChangeListener

(docIDs: string[]): void

ListenerToken

Opaque<unknown, 'ListenerToken'>

DocumentChangeListener

(docID: string): void

QueryRef

Opaque<{ readonly [resultType]: Result; readonly [parametersType]: Parameters; }, 'Query'>

Parameters

Obtain the parameters of a function type in a tuple

T extends (...args: infer P) => any ? P : never

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

QueryChangeListener

(results: T[]): void

Partial

Make all properties in T optional

{ [P in keyof T]?: T[P]; }

ReplicatorRef

Opaque<unknown, 'Replicator'>

DocumentReplicationListener

(direction: "push" | "pull", documents: ReplicatedDocInfo[]): void

ReplicatedDocInfo

{ id: string; accessRemoved: boolean; deleted: boolean; error?: string; }

ReplicatorChangeListener

(status: ReplicatorStatus): void

ReplicatorType

'pushAndPull' | 'push' | 'pull'

BlobConfig

{ data: Buffer; contentType?: string; }