/** * [[include:src/codecs/tdp/README.md]] * * @module codecs/tdp */ import schema from '@stencila/schema'; import * as vfile from '../../util/vfile'; import { Codec, CommonEncodeOptions } from '../types'; export declare class TDPCodec extends Codec implements Codec { readonly mediaTypes: string[]; readonly fileNames: string[]; readonly extNames: string[]; readonly decode: (file: vfile.VFile) => Promise; readonly encode: (node: schema.Node, { filePath }?: CommonEncodeOptions) => Promise; } /******************************************************************** * Field type, etc <-> DatatableColumnSchema ********************************************************************/ interface TypeFormatPattern { type: string | null; format: string | null; pattern: string | null; } /** * Decode a Frictionless Data Table Schema [types and formats](https://frictionlessdata.io/specs/table-schema/#types-and-formats) * to JSON Schema [`type`](https://json-schema.org/understanding-json-schema/reference/type.html) * and [`format`](https://json-schema.org/understanding-json-schema/reference/string.html#format). */ export declare function decodeFieldTypeFormat(type: null | string, format: null | string): TypeFormatPattern; /** * Decode a Frictionless Data Table Schema [constraints](https://frictionlessdata.io/specs/table-schema/#constraints) to * JSON Schema keywords such as `minimum`. * * Note that the the `unique` constraints are handled elsewhere. Only constraints that * apply to items should be returned here. */ export declare function decodeFieldConstraints(constraints: { [key: string]: any; }): { [key: string]: any; }; export {};