UNPKG

@prefecthq/prefect-ui-library

Version:

This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.

47 lines (46 loc) 4.01 kB
type Map = (...args: any) => any; type Maps = Record<string, Record<string, Map>>; type MapsMember<T extends Maps, S extends keyof T> = T[S][keyof T[S]]; type Mappers<T extends Maps, S extends keyof T> = Extract<MapsMember<T, S>, Map>; type MapperSourceType<T extends Maps, S extends keyof T> = Parameters<Mappers<T, S>>[0]; type MapperDestinationType<T extends Maps, S extends keyof T, D extends keyof T[S]> = ReturnType<T[S][D]>; export declare class Mapper<T extends Maps> { private readonly mapperFunctions; constructor(mapperFunctions: T); map<S extends keyof T, D extends keyof T[S]>(source: S, value: MapperSourceType<T, S>, destination: D): MapperDestinationType<T, S, D>; map<S extends keyof T, D extends keyof T[S]>(source: S, value: MapperSourceType<T, S> | null, destination: D): MapperDestinationType<T, S, D> | null; map<S extends keyof T, D extends keyof T[S]>(source: S, value: MapperSourceType<T, S> | undefined, destination: D): MapperDestinationType<T, S, D> | undefined; map<S extends keyof T, D extends keyof T[S]>(source: S, value: MapperSourceType<T, S> | null | undefined, destination: D): MapperDestinationType<T, S, D> | null | undefined; map<S extends keyof T, D extends keyof T[S]>(source: S, value: MapperSourceType<T, S>[], destination: D): MapperDestinationType<T, S, D>[]; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>>, destination: D): Record<string, MapperDestinationType<T, S, D>>; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>> | null, destination: D): Record<string, MapperDestinationType<T, S, D>> | null; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>> | undefined, destination: D): Record<string, MapperDestinationType<T, S, D>> | undefined; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>> | null | undefined, destination: D): Record<string, MapperDestinationType<T, S, D>> | null | undefined; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>[]>, destination: D): Record<string, MapperDestinationType<T, S, D>[]>; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>[]> | null, destination: D): Record<string, MapperDestinationType<T, S, D>[]> | null; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>[]> | undefined, destination: D): Record<string, MapperDestinationType<T, S, D>[]> | undefined; mapEntries<S extends keyof T, D extends keyof T[S]>(source: S, value: Record<string, MapperSourceType<T, S>[]> | null | undefined, destination: D): Record<string, MapperDestinationType<T, S, D>[]> | null | undefined; private bindMapper; } export declare const mapper: Mapper<{ SchemaResponse: { Schema: MapFunction<import(".").SchemaResponseV2, import(".").SchemaV2>; }; SchemaPropertyResponse: { SchemaProperty: MapFunction<import("./types/schemaResponse").SchemaPropertyResponse, import("./types/schema").SchemaProperty>; }; SchemaPropertiesResponse: { SchemaProperties: MapFunction<import("./types/schemaResponse").SchemaPropertiesResponse, import("./types/schema").SchemaProperties>; }; Schema: { SchemaResponse: MapFunction<import(".").SchemaV2, import(".").SchemaResponseV2>; }; SchemaProperty: { SchemaPropertyResponse: MapFunction<import("./types/schema").SchemaProperty, import("./types/schemaResponse").SchemaPropertyResponse>; }; SchemaProperties: { SchemaPropertiesResponse: MapFunction<import("./types/schema").SchemaProperties, import("./types/schemaResponse").SchemaPropertiesResponse>; }; }>; export type MapFunction<S, D> = (this: typeof mapper, source: S) => D; export {};