diff --git a/src/entrypoints/alpha/client.ts b/src/entrypoints/alpha/client.ts index 0914c7343..164f27ed8 100644 --- a/src/entrypoints/alpha/client.ts +++ b/src/entrypoints/alpha/client.ts @@ -1,3 +1,4 @@ export { create as createSelect, select } from '../../layers/5_select/select.js' -export { type Client, create, createPrefilled } from '../../layers/6_client/client.js' -export { type Input, type InputPrefilled } from '../../layers/6_client/Settings/Input.js' +export { type Client, create } from '../../layers/6_client/client.js' +export { createPrefilled, type InputPrefilled } from '../../layers/6_client/prefilled.js' +export { type Input } from '../../layers/6_client/Settings/Input.js' diff --git a/src/layers/6_client/Settings/Input.ts b/src/layers/6_client/Settings/Input.ts index bbb58eba2..f7369b1a0 100644 --- a/src/layers/6_client/Settings/Input.ts +++ b/src/layers/6_client/Settings/Input.ts @@ -5,6 +5,7 @@ import type { Schema } from '../../1_Schema/__.js' import type { GlobalRegistry } from '../../2_generator/globalRegistry.js' import type { TransportHttp, TransportMemory } from '../../5_core/types.js' import { Transport } from '../../5_core/types.js' +import type { InputPrefilled } from '../prefilled.js' import { type OutputChannel, type OutputChannelConfig, outputConfigDefault } from './Config.js' export type InputOutputEnvelopeLonghand = { @@ -179,6 +180,3 @@ const inferTransport = >(input: T): InferTransport => { // @ts-expect-error conditional type return input.schema instanceof URL || typeof input.schema === `string` ? Transport.http : Transport.memory } - -export type InputPrefilled<$Schema extends GlobalRegistry.SchemaList> = $Schema extends any ? (InputRaw<$Schema>) - : never diff --git a/src/layers/6_client/client.ts b/src/layers/6_client/client.ts index fb1322839..6eef499dc 100644 --- a/src/layers/6_client/client.ts +++ b/src/layers/6_client/client.ts @@ -3,7 +3,6 @@ import type { Anyware } from '../../lib/anyware/__.js' import { Errors } from '../../lib/errors/__.js' import type { SomeExecutionResultWithoutErrors } from '../../lib/graphql.js' import { isOperationTypeName, operationTypeNameToRootTypeName, type RootTypeName } from '../../lib/graphql.js' -import type { Exact } from '../../lib/prelude.js' import { isPlainObject } from '../../lib/prelude.js' import type { URLInput } from '../0_functions/request.js' import type { BaseInput } from '../0_functions/types.js' @@ -24,7 +23,7 @@ import { traditionalGraphqlOutput, traditionalGraphqlOutputThrowing, } from './Settings/Config.js' -import { type Input, type InputPrefilled, type InputToConfig, inputToConfig } from './Settings/Input.js' +import { type Input, type InputToConfig, inputToConfig } from './Settings/Input.js' export type SchemaInput = URLInput | GraphQLSchema @@ -105,29 +104,6 @@ export type ClientTyped<$Index extends Schema.Index, $Config extends Config> = } & GetRootTypeMethods<$Config, $Index> -// dprint-ignore -export type CreatePrefilled = <$Name extends GlobalRegistry.SchemaNames>(name: $Name, schemaIndex: Schema.Index) => < - // eslint-disable-next-line - // @ts-ignore passes after generation - $Input extends InputPrefilled, ->( - // eslint-disable-next-line - // @ts-ignore passes after generation - input: Exact<$Input, InputPrefilled>, -) => -Client< - // eslint-disable-next-line - // @ts-ignore passes after generation - GlobalRegistry.GetSchemaIndexOrDefault<$Name>, - InputToConfig<$Input> -> - -export const createPrefilled: CreatePrefilled = (name, schemaIndex) => { - // eslint-disable-next-line - // @ts-ignore passes after generation - return (input) => create({ ...input, name, schemaIndex }) as any -} - // dprint-ignore type Create = < $Input extends Input,