Skip to content

Commit

Permalink
feat: export Store types (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Nov 14, 2023
1 parent df46034 commit f04eaa5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
export { getDeployStore, getStore } from './store_factory.ts'
export { BlobsServer } from './server.ts'
export type {
Store,
StoreOptions,
GetWithMetadataOptions,
GetWithMetadataResult,
ListOptions,
ListResultBlob,
SetOptions,
BlobResponseType,
} from './store.ts'
14 changes: 7 additions & 7 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ interface NamedStoreOptions extends BaseStoreOptions {
name: string
}

type StoreOptions = DeployStoreOptions | NamedStoreOptions
export type StoreOptions = DeployStoreOptions | NamedStoreOptions

interface GetWithMetadataOptions {
export interface GetWithMetadataOptions {
etag?: string
}

interface GetWithMetadataResult {
export interface GetWithMetadataResult {
etag?: string
metadata: Metadata
}
Expand All @@ -34,26 +34,26 @@ export interface ListResult {
directories: string[]
}

interface ListResultBlob {
export interface ListResultBlob {
etag: string
key: string
}

interface ListOptions {
export interface ListOptions {
directories?: boolean
paginate?: boolean
prefix?: string
}

interface SetOptions {
export interface SetOptions {
/**
* Arbitrary metadata object to associate with an entry. Must be seralizable
* to JSON.
*/
metadata?: Metadata
}

type BlobResponseType = 'arrayBuffer' | 'blob' | 'json' | 'stream' | 'text'
export type BlobResponseType = 'arrayBuffer' | 'blob' | 'json' | 'stream' | 'text'

export class Store {
private client: Client
Expand Down

0 comments on commit f04eaa5

Please sign in to comment.