import { Preset } from '../..'; import { arktype } from '../../esm-modules'; import { StandardSchemaV1 } from '../../standard-schema'; type $ = {}; /** define a preset using an arktype schema definition. note that you don't have to import arktype */ export declare function definePreset>(def: arktype.type.validate, fn: arktype.type.infer extends Record ? Preset> : 'Options must be an object'): Exclude; /** define a perset using any standard-schema definition (zod, arktype, effect, etc.) */ export declare function definePreset(schema: StandardSchemaV1, fn: Preset): Preset; /** * Use this to define a preset, with runtime and compile-time type checking, without importing any values from this library. * All you need to do is implement an identity function, then at lint time the plugin will do the rest. * * @example * ```ts * const definePreset: import('eslint-plugin-codegen').DefinePreset = (...args) => args * * export const myPreset = definePreset({ foo: 'string' }, ({options}) => { * return options.foo.slice() * }) * ``` * * (you can use jsdoc to define the type in plain js too) * */ export type DefinePreset = >(def: arktype.type.validate, fn: arktype.type.infer extends Record ? Preset> : 'Options must be an object') => [typeof def, typeof fn]; export {};