diff --git a/src/query/utils.ts b/src/query/utils.ts index 40c9ddf..66c2614 100644 --- a/src/query/utils.ts +++ b/src/query/utils.ts @@ -22,7 +22,7 @@ import { Err, Ok, type Result, resolve } from "../result/index.js"; * @template TData - The type of data returned by the query (after select transform) * @template TQueryKey - The type of the query key */ -export type DefineQueryInput< +type DefineQueryInput< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, @@ -69,7 +69,7 @@ export type DefineQueryInput< * const query = useQuery(userQuery.options); // React * ``` */ -export type DefineQueryOutput< +type DefineQueryOutput< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, @@ -99,7 +99,7 @@ export type DefineQueryOutput< * @template TVariables - The type of variables passed to the mutation * @template TContext - The type of context data for optimistic updates */ -export type DefineMutationInput< +type DefineMutationInput< TData, TError, TVariables = void, @@ -140,7 +140,7 @@ export type DefineMutationInput< * const mutation = useMutation(createUser.options); // React * ``` */ -export type DefineMutationOutput< +type DefineMutationOutput< TData, TError, TVariables = void, diff --git a/src/result/result.ts b/src/result/result.ts index 35a7b54..affe2d7 100644 --- a/src/result/result.ts +++ b/src/result/result.ts @@ -95,34 +95,6 @@ export const Ok = (data: T): Ok => ({ data, error: null }); */ export const Err = (error: E): Err => ({ error, data: null }); -/** - * Utility type to extract the `Ok` variant from a `Result` union type. - * - * If `R` is a `Result` type (e.g., `Result`), this type will resolve - * to `Ok`. This can be useful in generic contexts or for type narrowing. - * - * @template R - The `Result` union type from which to extract the `Ok` variant. - * Must extend `Result`. - */ -export type ExtractOkFromResult> = Extract< - R, - { error: null } ->; - -/** - * Utility type to extract the `Err` variant from a `Result` union type. - * - * If `R` is a `Result` type (e.g., `Result`), this type will resolve - * to `Err`. This can be useful in generic contexts or for type narrowing. - * - * @template R - The `Result` union type from which to extract the `Err` variant. - * Must extend `Result`. - */ -export type ExtractErrFromResult> = Extract< - R, - { data: null } ->; - /** * Utility type to extract the success value's type `T` from a `Result` type. * diff --git a/src/standard-schema/index.ts b/src/standard-schema/index.ts index 557aa79..ab89659 100644 --- a/src/standard-schema/index.ts +++ b/src/standard-schema/index.ts @@ -5,7 +5,6 @@ export { ResultSchema, type Result } from "./result.js"; export { hasJsonSchema, hasValidate, - type StandardFullSchemaV1, type StandardJSONSchemaV1, type StandardSchemaV1, type StandardTypedV1, diff --git a/src/standard-schema/types.ts b/src/standard-schema/types.ts index def08cc..63111b7 100644 --- a/src/standard-schema/types.ts +++ b/src/standard-schema/types.ts @@ -192,18 +192,6 @@ export declare namespace StandardJSONSchemaV1 { StandardTypedV1.InferOutput; } -// ############################### -// ### Utility Types ### -// ############################### - -/** - * A schema that implements both StandardSchemaV1 and StandardJSONSchemaV1. - */ -export type StandardFullSchemaV1 = { - readonly "~standard": StandardSchemaV1.Props & - StandardJSONSchemaV1.Props; -}; - /** * Checks if a schema has validation capability. */