Skip to content

Commit

Permalink
chore: Forgot to run pre-pr command
Browse files Browse the repository at this point in the history
  • Loading branch information
untio11 committed Feb 13, 2025
1 parent a1cafb3 commit 3f73f39
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
5 changes: 4 additions & 1 deletion etc/types.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
```ts

import { StandardSchemaV1 } from '@standard-schema/spec';

// @public
export function array<ElementType extends BaseTypeImpl<any>>(...args: [name: string, elementType: ElementType, typeConfig?: ArrayTypeConfig] | [elementType: ElementType, typeConfig?: ArrayTypeConfig]): TypeImpl<ArrayType<ElementType, TypeOf<ElementType>, Array<TypeOf<ElementType>>>>;

Expand Down Expand Up @@ -56,7 +58,8 @@ export abstract class BaseObjectLikeTypeImpl<ResultType, TypeConfig = unknown> e
}

// @public
export abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements TypeLink<ResultType> {
export abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements TypeLink<ResultType>, StandardSchemaV1<unknown, ResultType> {
get ['~standard'](): StandardSchemaV1.Props<unknown, ResultType>;
// @internal
readonly [designType]: ResultType;
abstract accept<R>(visitor: Visitor<R>): R;
Expand Down
13 changes: 13 additions & 0 deletions markdown/types.basetypeimpl.__standard_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@skunkteam/types](./types.md) &gt; [BaseTypeImpl](./types.basetypeimpl.md) &gt; ["\~standard"](./types.basetypeimpl.__standard_.md)

## BaseTypeImpl."\~standard" property

Skunkteam Types implementation of \[StandardSchemaV1\](https://standardschema.dev/)

**Signature:**

```typescript
get ['~standard'](): StandardSchemaV1.Props<unknown, ResultType>;
```
5 changes: 3 additions & 2 deletions markdown/types.basetypeimpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ The base-class of all type-implementations.
**Signature:**

```typescript
declare abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements TypeLink<ResultType>
declare abstract class BaseTypeImpl<ResultType, TypeConfig = unknown> implements TypeLink<ResultType>, StandardSchemaV1<unknown, ResultType>
```
**Implements:** [TypeLink](./types.typelink.md)<!-- -->&lt;ResultType&gt;
**Implements:** [TypeLink](./types.typelink.md)<!-- -->&lt;ResultType&gt;, StandardSchemaV1&lt;unknown, ResultType&gt;
## Remarks
Expand All @@ -22,6 +22,7 @@ All type-implementations must extend this base class. Use [createType()](./types
| Property | Modifiers | Type | Description |
| --------------------------------------------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ["\~standard"](./types.basetypeimpl.__standard_.md) | <code>readonly</code> | StandardSchemaV1.Props&lt;unknown, ResultType&gt; | Skunkteam Types implementation of \[StandardSchemaV1\](https://standardschema.dev/) |
| [basicType](./types.basetypeimpl.basictype.md) | <p><code>abstract</code></p><p><code>readonly</code></p> | [BasicType](./types.basictype.md) \| 'mixed' | The kind of values this type validates. |
| [check](./types.basetypeimpl.check.md) | <code>readonly</code> | (this: void, input: unknown) =&gt; ResultType | Asserts that a value conforms to this Type and returns the input as is, if it does. |
| [customValidators](./types.basetypeimpl.customvalidators.md) | <p><code>protected</code></p><p><code>readonly</code></p> | ReadonlyArray&lt;[Validator](./types.validator.md)<!-- -->&lt;unknown&gt;&gt; | Additional custom validation added using [withValidation](./types.basetypeimpl.withvalidation.md) or [withConstraint](./types.basetypeimpl.withconstraint.md)<!-- -->. |
Expand Down
3 changes: 3 additions & 0 deletions src/base-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ export abstract class BaseTypeImpl<ResultType, TypeConfig = unknown>
return { ...oldConfig, ...newConfig };
}

/**
* Skunkteam Types implementation of [StandardSchemaV1](https://standardschema.dev/)
*/
get ['~standard'](): StandardSchemaV1.Props<unknown, ResultType> {
return (this._instanceCache.standardSchema ??= {
version: 1,
Expand Down

0 comments on commit 3f73f39

Please sign in to comment.