## API Report File for "@fgv/ts-http-storage"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { Converter } from '@fgv/ts-utils';
import { Hono } from 'hono';
import type { Logging } from '@fgv/ts-utils';
import { Result } from '@fgv/ts-utils';

// @public
export function createStorageRoutes(options: ICreateStorageRoutesOptions): Hono;

// @public
export class FsStorageProvider implements IHttpStorageProvider {
    constructor(rootPath: string);
    // (undocumented)
    createDirectory(itemPath: string): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    deleteFile(itemPath: string): Promise<Result<boolean>>;
    // (undocumented)
    getChildren(itemPath: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
    // (undocumented)
    getFile(itemPath: string): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    getItem(itemPath: string): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    saveFile(itemPath: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    sync(): Promise<Result<IStorageSyncResponse>>;
}

// @public
export class FsStorageProviderFactory implements IHttpStorageProviderFactory {
    constructor(options: IFsStorageProviderFactoryOptions);
    // (undocumented)
    forNamespace(namespace?: string): Result<IHttpStorageProvider>;
}

// @public
export class HttpStorageService {
    constructor(providers: IHttpStorageProviderFactory);
    // (undocumented)
    createDirectory(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    deleteFile(request: IStoragePathRequest): Promise<Result<boolean>>;
    // (undocumented)
    getChildren(request: IStoragePathRequest): Promise<Result<IStorageTreeChildrenResponse>>;
    // (undocumented)
    getFile(request: IStoragePathRequest): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    getItem(request: IStoragePathRequest): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    saveFile(request: IStorageWriteFileRequest): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    sync(request: IStorageSyncRequest): Promise<Result<IStorageSyncResponse>>;
}

// @public
export interface ICreateStorageRoutesOptions {
    // (undocumented)
    readonly logger?: Logging.ILogger;
    // (undocumented)
    readonly providers: IHttpStorageProviderFactory;
}

// @public
export interface IFsStorageProviderFactoryOptions {
    // (undocumented)
    readonly rootPath: string;
}

// @public
export interface IHttpStorageProvider {
    // (undocumented)
    createDirectory(path: string): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    deleteFile(path: string): Promise<Result<boolean>>;
    // (undocumented)
    getChildren(path: string): Promise<Result<ReadonlyArray<IStorageTreeItem>>>;
    // (undocumented)
    getFile(path: string): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    getItem(path: string): Promise<Result<IStorageTreeItem>>;
    // (undocumented)
    saveFile(path: string, contents: string, contentType?: string): Promise<Result<IStorageFileResponse>>;
    // (undocumented)
    sync(): Promise<Result<IStorageSyncResponse>>;
}

// @public
export interface IHttpStorageProviderFactory {
    // (undocumented)
    forNamespace(namespace?: StorageNamespace): Result<IHttpStorageProvider>;
}

// @public
export interface IStorageFileResponse {
    // (undocumented)
    readonly contents: string;
    // (undocumented)
    readonly contentType?: string;
    // (undocumented)
    readonly path: string;
}

// @public
export interface IStoragePathRequest {
    // (undocumented)
    readonly namespace?: StorageNamespace;
    // (undocumented)
    readonly path: string;
}

// @public
export interface IStorageSyncRequest {
    // (undocumented)
    readonly namespace?: StorageNamespace;
}

// @public
export interface IStorageSyncResponse {
    // (undocumented)
    readonly synced: number;
}

// @public
export interface IStorageTreeChildrenResponse {
    // (undocumented)
    readonly children: ReadonlyArray<IStorageTreeItem>;
    // (undocumented)
    readonly path: string;
}

// @public
export interface IStorageTreeItem {
    // (undocumented)
    readonly name: string;
    // (undocumented)
    readonly path: string;
    // (undocumented)
    readonly type: StorageItemType;
}

// @public
export interface IStorageWriteFileRequest extends IStoragePathRequest {
    // (undocumented)
    readonly contents: string;
    // (undocumented)
    readonly contentType?: string;
}

// @public
export function normalizeRequestPath(requestPath: string): string;

// @public
export function sanitizeNamespace(namespace?: string): Result<string>;

// @public
export const storageFileResponse: Converter<IStorageFileResponse>;

// @public
export type StorageItemType = 'file' | 'directory';

// @public
export type StorageNamespace = string;

// @public
export const storagePathRequest: Converter<IStoragePathRequest>;

// @public
export const storageSyncRequest: Converter<IStorageSyncRequest>;

// @public
export const storageTreeChildrenResponse: Converter<IStorageTreeChildrenResponse>;

// @public
export const storageTreeItem: Converter<IStorageTreeItem>;

// @public
export const storageWriteFileRequest: Converter<IStorageWriteFileRequest>;

```
