@@ -64,7 +64,7 @@ export abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements
64
64
protected createAutoCastAllType(): this ;
65
65
protected createResult(input : unknown , result : unknown , validatorResult : ValidationResult ): Result <ResultType >;
66
66
readonly enumerableLiteralDomain? : Iterable <LiteralValue >;
67
- extendWith<E >(factory : (type : this ) => E ): this & E ;
67
+ extendWith<const E >(factory : (type : this ) => E ): this & E ;
68
68
get is(): TypeguardFor <ResultType >;
69
69
literal(input : DeepUnbranded <ResultType >): ResultType ;
70
70
maybeStringify(value : ResultType ): string | undefined ;
@@ -75,9 +75,9 @@ export abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements
75
75
protected typeParser? (input : unknown , options : ValidationOptions ): Result <unknown >;
76
76
protected abstract typeValidator(input : unknown , options : ValidationOptions ): Result <ResultType >;
77
77
validate(input : unknown , options ? : ValidationOptions ): Result <ResultType >;
78
- withBrand<BrandName extends string >(name : BrandName ): Type <Branded <ResultType , BrandName >, TypeConfig >;
79
- withConfig<BrandName extends string >(name : BrandName , newConfig : TypeConfig ): Type <Branded <ResultType , BrandName >, TypeConfig >;
80
- withConstraint<BrandName extends string >(name : BrandName , constraint : Validator <ResultType >): Type <Branded <ResultType , BrandName >, TypeConfig >;
78
+ withBrand<const BrandName extends string >(name : BrandName ): Type <Branded <ResultType , BrandName >, TypeConfig >;
79
+ withConfig<const BrandName extends string >(name : BrandName , newConfig : TypeConfig ): Type <Branded <ResultType , BrandName >, TypeConfig >;
80
+ withConstraint<const BrandName extends string >(name : BrandName , constraint : Validator <ResultType >): Type <Branded <ResultType , BrandName >, TypeConfig >;
81
81
withName(name : string ): this ;
82
82
withParser(... args : [newConstructor : (i : unknown ) => unknown ] | [name : string , newConstructor : (i : unknown ) => unknown ] | [options : ParserOptions , newConstructor : (i : unknown ) => unknown ]): this ;
83
83
withValidation(validation : Validator <ResultType >): this ;
@@ -230,7 +230,7 @@ export interface LengthChecksConfig {
230
230
export type LengthViolation = ' minLength' | ' maxLength' ;
231
231
232
232
// @public (undocumented)
233
- export function literal<T extends LiteralValue >(value : T ): TypeImpl <LiteralType <T >>;
233
+ export function literal<const T extends LiteralValue >(value : T ): TypeImpl <LiteralType <T >>;
234
234
235
235
// @public
236
236
export class LiteralType <ResultType extends LiteralValue > extends BaseTypeImpl <ResultType > {
@@ -345,7 +345,7 @@ export function partial<Props extends Properties>(...args: [props: Props] | [nam
345
345
export type PartialType <Props extends Properties > = TypeImpl <InterfaceType <Props , Partial <TypeOfProperties <Writable <Props >>>>>;
346
346
347
347
// @public (undocumented)
348
- export function pattern<BrandName extends string >(name : BrandName , regExp : RegExp , customMessage ? : StringTypeConfig [' customMessage' ]): Type <Branded <string , BrandName >, StringTypeConfig >;
348
+ export function pattern<const BrandName extends string >(name : BrandName , regExp : RegExp , customMessage ? : StringTypeConfig [' customMessage' ]): Type <Branded <string , BrandName >, StringTypeConfig >;
349
349
350
350
// @public
351
351
export type PossibleDiscriminator = {
@@ -370,7 +370,7 @@ export function printPath(path: ReadonlyArray<PropertyKey>): string;
370
370
export function printValue(input : unknown , budget ? : number , visited ? : Set <unknown >): string ;
371
371
372
372
// @public
373
- export type Properties = Record <string , Type <unknown >>;
373
+ export type Properties = Record <string , Type <any >>;
374
374
375
375
// @public
376
376
export type PropertiesInfo <Props extends Properties = Properties > = {
@@ -494,7 +494,7 @@ Extract<Input, ResultType>
494
494
// @public
495
495
export type TypeImpl <Impl extends BaseTypeImpl <any , any >> = Impl & {
496
496
new (input : unknown ): TypeOf <Impl >;
497
- (input : unknown ): TypeOf <Impl >;
497
+ (this : void , input : unknown ): TypeOf <Impl >;
498
498
};
499
499
500
500
// @public
@@ -640,7 +640,7 @@ export const voidType: TypeImpl<LiteralType<void>>;
640
640
641
641
// @public (undocumented)
642
642
export type WithBrands <T , BrandNames extends string > = T & {
643
- [brands ]: {
643
+ readonly [brands ]: {
644
644
[P in BrandNames ]: true ;
645
645
};
646
646
};
0 commit comments