@datapos/datapos-shared
    Preparing search index...

    Interface ConnectorTools

    interface ConnectorTools {
        csvParse: {
            <T = unknown>(
                input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
                options: OptionsWithColumns<T>,
                callback?: Callback<T>,
            ): Parser;
            (
                input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
                options: Options,
                callback?: Callback<string[]>,
            ): Parser;
            <T = unknown>(
                options: OptionsWithColumns<T>,
                callback?: Callback<T>,
            ): Parser;
            (options: Options, callback?: Callback<string[]>): Parser;
            (
                input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
                callback?: Callback<string[]>,
            ): Parser;
            (callback?: Callback<string[]>): Parser;
        };
        dataPos: {
            buildFetchError: (
                response: {
                    status: number;
                    statusText: string;
                    text: () => Promise<string>;
                },
                message: string,
                locator: string,
            ) => Promise<FetchError>;
            extractExtensionFromPath: (itemPath: string) => string | undefined;
            extractNameFromPath: (itemPath: string) => string | undefined;
            lookupMimeTypeForExtension: (extension?: string) => string;
            OperationalError: typeof OperationalError;
        };
        dateFns: {
            parse: <DateType extends Date, ResultDate extends Date = DateType>(
                dateStr: string,
                formatStr: string,
                referenceDate: DateArg<DateType>,
                options?: ParseOptions<ResultDate>,
            ) => ResultDate;
        };
        nanoid: <Type extends string>(size?: number) => Type;
    }
    Index

    Properties

    csvParse: {
        <T = unknown>(
            input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
            options: OptionsWithColumns<T>,
            callback?: Callback<T>,
        ): Parser;
        (
            input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
            options: Options,
            callback?: Callback<string[]>,
        ): Parser;
        <T = unknown>(
            options: OptionsWithColumns<T>,
            callback?: Callback<T>,
        ): Parser;
        (options: Options, callback?: Callback<string[]>): Parser;
        (
            input: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>,
            callback?: Callback<string[]>,
        ): Parser;
        (callback?: Callback<string[]>): Parser;
    }
    dataPos: {
        buildFetchError: (
            response: {
                status: number;
                statusText: string;
                text: () => Promise<string>;
            },
            message: string,
            locator: string,
        ) => Promise<FetchError>;
        extractExtensionFromPath: (itemPath: string) => string | undefined;
        extractNameFromPath: (itemPath: string) => string | undefined;
        lookupMimeTypeForExtension: (extension?: string) => string;
        OperationalError: typeof OperationalError;
    }

    Type Declaration

    • buildFetchError: (
          response: {
              status: number;
              statusText: string;
              text: () => Promise<string>;
          },
          message: string,
          locator: string,
      ) => Promise<FetchError>
    • extractExtensionFromPath: (itemPath: string) => string | undefined
    • extractNameFromPath: (itemPath: string) => string | undefined
    • lookupMimeTypeForExtension: (extension?: string) => string
    • OperationalError: typeof OperationalError
    dateFns: {
        parse: <DateType extends Date, ResultDate extends Date = DateType>(
            dateStr: string,
            formatStr: string,
            referenceDate: DateArg<DateType>,
            options?: ParseOptions<ResultDate>,
        ) => ResultDate;
    }

    Type Declaration

    • parse: <DateType extends Date, ResultDate extends Date = DateType>(
          dateStr: string,
          formatStr: string,
          referenceDate: DateArg<DateType>,
          options?: ParseOptions<ResultDate>,
      ) => ResultDate
    nanoid: <Type extends string>(size?: number) => Type

    Type Declaration

      • <Type extends string>(size?: number): Type
      • Generate secure URL-friendly unique ID.

        By default, the ID will have 21 symbols to have a collision probability similar to UUID v4.

        import { nanoid } from 'nanoid'
        model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"

        Type Parameters

        • Type extends string

        Parameters

        • Optionalsize: number

          Size of the ID. The default size is 21.

        Returns Type

        A random string.

        Type The ID type to replace string with some opaque type.