Skip to content

Commit

Permalink
docs: add apis
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshyadavdev committed Sep 7, 2024
1 parent abc545c commit 62196f4
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 154 deletions.
11 changes: 10 additions & 1 deletion website/src/routes/api/(async)/nullableAsync/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ import { properties } from './properties';

# nullableAsync

> The content of this page is not yet ready. Until then, please use the [source code](https://github.com/fabian-hiller/valibot/blob/main/library/src/schemas/nullable/nullableAsync.ts) or take a look at [issue #287](https://github.com/fabian-hiller/valibot/issues/287) to help us extend the API reference.
Creates a nullable schema.

```ts
const Schema = v.nullableAsync<TWrapped, TDefault>(wrapped, default);
```

## Generics

- `TWrapped` <Property {...properties.TWrapped} />
- `TDefault` <Property {...properties.TDefault} />
163 changes: 87 additions & 76 deletions website/src/routes/api/(async)/nullableAsync/properties.ts
Original file line number Diff line number Diff line change
@@ -1,130 +1,141 @@
import type { PropertyProps } from '~/components';

export const properties: Record<string, PropertyProps> = {
TKey: {
TWrapped: {
modifier: 'extends',
type: {
type: 'union',
options: [
type: 'custom',
name: 'BaseSchema',
href: '../BaseSchema/',
generics: [
'unknown',
'unknown',
{
type: 'custom',
name: 'BaseSchema',
href: '../BaseSchema/',
generics: [
'unknown',
'unknown',
{
type: 'custom',
name: 'BaseIssue',
href: '../BaseIssue/',
generics: ['unknown'],
},
],
name: 'BaseIssue',
href: '../BaseIssue/',
generics: ['unknown'],
},
],
},
},
TDefault: {
modifier: 'extends',
type: {
type: 'custom',
name: 'Default',
href: '../Default/',
generics: [
{
type: 'custom',
name: 'BaseSchemaAsync',
href: '../BaseSchemaAsync/',
generics: [
'unknown',
'unknown',
{
type: 'custom',
name: 'BaseIssue',
href: '../BaseIssue/',
generics: ['unknown'],
},
],
name: 'TWrapped',
},
'undefined',
],
},
},
TValue: {
BaseSchema: {
modifier: 'extends',
type: {
type: 'union',
options: [
type: 'custom',
name: 'BaseSchema',
href: '../BaseSchema/',
generics: [
{
type: 'custom',
name: 'BaseSchema',
href: '../BaseSchema/',
generics: [
'unknown',
'unknown',
type: 'union',
options: [
{
type: 'custom',
name: 'BaseIssue',
href: '../BaseIssue/',
generics: ['unknown'],
name: 'InferInput',
href: '../InferInput/',
generics: [
{
type: 'custom',
name: 'TWrapped',
},
],
},
'undefined',
],
},
{
type: 'custom',
name: 'BaseSchemaAsync',
href: '../BaseSchemaAsync/',
name: 'InferOptionalOutput',
href: '../InferOptionalOutput/',
generics: [
'unknown',
'unknown',
{
type: 'custom',
name: 'BaseIssue',
href: '../BaseIssue/',
generics: ['unknown'],
name: 'TWrapped',
},
{
type: 'custom',
name: 'TDefault',
},
],
},
],
},
},
TDefault: {
modifier: 'extends',
type: {
type: 'custom',
name: 'Default',
href: '../Default/',
generics: [
{
type: 'custom',
name: 'TWrapped',
name: 'InferIssue',
href: '../InferIssue/',
generics: [
{
type: 'custom',
name: 'TWrapped',
},
],
},
'undefined',
],
},
},
key: {
type: {
type: 'custom',
name: 'TKey',
},
},
value: {
type: {
type: {
type: 'custom',
name: 'TValue',
type: 'string',
value: 'optional',
},
},
message: {
reference: {
type: {
type: 'custom',
name: 'TMessage',
modifier: 'typeof',
name: 'optional',
href: '../optional/',
},
},
Schema: {
expects: {
type: {
type: 'custom',
name: 'nullableAsync',
href: '../nullableAsync/',
generics: [
type: 'template',
parts: [
{
type: 'string',
value: '(',
},
{
type: 'custom',
name: 'TWrapped',
indexes: [
{
type: 'string',
value: 'expects',
},
],
},
{
type: 'custom',
name: 'TDefault',
type: 'string',
value: ' | undefined)',
},
],
},
},
wrapped: {
type: {
type: 'custom',
name: 'TWrapped',
},
},
default: {
type: {
type: 'custom',
name: 'TDefault',
},
},
};
11 changes: 10 additions & 1 deletion website/src/routes/api/(async)/nullishAsync/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ import { properties } from './properties';

# nullishAsync

> The content of this page is not yet ready. Until then, please use the [source code](https://github.com/fabian-hiller/valibot/blob/main/library/src/schemas/nullish/nullishAsync.ts) or take a look at [issue #287](https://github.com/fabian-hiller/valibot/issues/287) to help us extend the API reference.
Creates a nullish schema.

```ts
const Schema = v.nullishAsync<TWrapped, TDefault>(wrapped, default);
```

## Generics

- `TWrapped` <Property {...properties.TWrapped} />
- `TDefault` <Property {...properties.TDefault} />
Loading

0 comments on commit 62196f4

Please sign in to comment.