Skip to content

Commit

Permalink
chore: update versions (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 16, 2023
1 parent db0e268 commit 00eb82f
Show file tree
Hide file tree
Showing 57 changed files with 1,558 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# arktype

## 1.0.24-alpha

### Patch Changes

- Add inferDefinition, validateDefinition and PrecompiledDefaults to primary entrypoint

## 1.0.23-alpha

### Patch Changes
Expand Down
23 changes: 23 additions & 0 deletions dev/arktype.io/docs/api/inferdefinition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
hide_table_of_contents: true
---

# inferDefinition

## text

```ts
export type inferDefinition<def, $> = isAny<def> extends true
? never
: def extends Infer<infer t> | InferredThunk<infer t>
? t
: def extends string
? inferString<def, $>
: def extends List
? inferTuple<def, $>
: def extends RegExp
? string
: def extends Dict
? inferRecord<def, $>
: never
```
48 changes: 48 additions & 0 deletions dev/arktype.io/docs/api/precompileddefaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
hide_table_of_contents: true
---

# PrecompiledDefaults

## text

```ts
export type PrecompiledDefaults = {
any: any
bigint: bigint
boolean: boolean
false: false
never: never
null: null
number: number
object: object
string: string
symbol: symbol
true: true
unknown: unknown
void: void
undefined: undefined
integer: number
alpha: string
alphanumeric: string
lowercase: string
uppercase: string
creditCard: string
email: string
uuid: string
semver: string
json: (In: string) => unknown
parsedNumber: (In: string) => number
parsedInteger: (In: string) => number
parsedDate: (In: string) => Date
Function: (...args: any[]) => unknown
Date: Date
Error: Error
Map: Map<unknown, unknown>
RegExp: RegExp
Set: Set<unknown>
WeakMap: WeakMap<object, unknown>
WeakSet: WeakSet<object>
Promise: Promise<unknown>
}
```
27 changes: 27 additions & 0 deletions dev/arktype.io/docs/api/validatedefinition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
hide_table_of_contents: true
---

# validateDefinition

## text

```ts
export type validateDefinition<def, $> = [def] extends [(...args: any[]) => any]
? def
: def extends Terminal
? def
: def extends string
? validateString<def, $>
: def extends TupleExpression
? validateTupleExpression<def, $>
: def extends BadDefinitionType
? writeBadDefinitionTypeMessage<
objectKindOf<def> extends string ? objectKindOf<def> : domainOf<def>
>
: isUnknown<def> extends true
? stringKeyOf<$>
: evaluate<{
[k in keyof def]: validateDefinition<def[k], $>
}>
```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const createStackblitzDemo = async ({ embedId }: DemoProps) =>
template: "typescript",
dependencies: {
// @lineFrom:package.json:version |> embed("arktype":,,)
arktype: "1.0.23-alpha"
arktype: "1.0.24-alpha"
},
settings: {
compile: {
Expand Down
15 changes: 15 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
id: api
hide_table_of_contents: true
title: API
---

# API

<!-- @blockFrom:README.md:api |> replace(./dev/test,https://github.com/arktypeio/arktype/tree/main/dev/test) -->

ArkType supports many of TypeScript's built-in types and operators, as well as some new ones dedicated exclusively to runtime validation. In fact, we got a little ahead of ourselves and built a ton of cool features, but we're still working on getting caught up syntax and API docs. Keep an eye out for more in the next couple weeks

In the meantime, check out the examples here and use the type hints you get to learn how you can customize your types and scopes. If you want to explore some of the more advanced features, take a look at [our unit tests](https://github.com/arktypeio/arktype/tree/main/dev/test) or ask us [on Discord](https://discord.gg/xEzdc3fJQC) if your functionality is supported. If not, [create a GitHub issue](https://github.com/arktypeio/arktype/issues/new) so we can prioritize it!

<!-- @blockEnd -->
11 changes: 11 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api/ark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
hide_table_of_contents: true
---

# ark

## text

```ts
ark: Space<PrecompiledDefaults>
```
54 changes: 54 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api/arkscope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
hide_table_of_contents: true
---

# arkScope

## text

```ts
arkScope: import("./scope.js").Scope<
[
{
any: any
bigint: bigint
boolean: boolean
false: false
never: never
null: null
number: number
object: object
string: string
symbol: symbol
true: true
unknown: unknown
void: void
undefined: undefined
Function: (...args: any[]) => unknown
Date: Date
Error: Error
Map: Map<unknown, unknown>
RegExp: RegExp
Set: Set<unknown>
WeakMap: WeakMap<object, unknown>
WeakSet: WeakSet<object>
Promise: Promise<unknown>
alpha: string
alphanumeric: string
lowercase: string
uppercase: string
creditCard: string
email: string
uuid: string
parsedNumber: (In: string) => number
parsedInteger: (In: string) => number
parsedDate: (In: string) => Date
semver: string
json: (In: string) => unknown
integer: number
},
{},
false
]
>
```
24 changes: 24 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api/arrayof.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
hide_table_of_contents: true
---

# arrayOf

## operator

- [arrayOf](./arrayof.md)

## string

- "T[]" <br/>
- const numberArray = type("number[]")<br/>

## tuple

- [T, "[]"] <br/>
- const tupleArray = type(["number", "[]"])<br/>

## helper

- arrayOf(T) <br/>
- const helperArray = arrayOf("number")<br/>
13 changes: 13 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api/infer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
hide_table_of_contents: true
---

# Infer

## text

```ts
export type Infer<t> = {
[as]?: t
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
hide_table_of_contents: true
---

# inferDefinition

## text

```ts
export type inferDefinition<def, $> = isAny<def> extends true
? never
: def extends Infer<infer t> | InferredThunk<infer t>
? t
: def extends string
? inferString<def, $>
: def extends List
? inferTuple<def, $>
: def extends RegExp
? string
: def extends Dict
? inferRecord<def, $>
: never
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
hide_table_of_contents: true
---

# instanceOf

## operator

- [instanceOf](./instanceof.md)

## tuple

- ["instanceOf", T] <br/>
- const tupleInstanceOf = type(["instanceOf", Date])<br/>

## helper

- instanceOf(T) <br/>
- const helperInstanceOf = instanceOf(Date)<br/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
hide_table_of_contents: true
---

# intersection

## operator

- [&](./intersection.md)

## string

- "L&R" <br/>
- const intersection = type("/@arktype\.io$/ & email")<br/>

## tuple

- [L, "&", R] <br/>
- const tupleIntersection = type(["/@arktype\.io$/", "&", "email"])<br/>

## helper

- intersection(L,R) <br/>
- const helperIntersection = intersection("/@arktype\.io$/","email")<br/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
hide_table_of_contents: true
---

# jsObjectsScope

## text

| Name | Type | Description |
| -------- | ------------------------------ | ----------- |
| Function | ` (...args: any[]) => unknown` | |
| Date | ` Date` | |
| Error | ` Error` | |
| Map | ` Map<unknown, unknown>` | |
| RegExp | ` RegExp` | |
| Set | ` Set<unknown>` | |
| WeakMap | ` WeakMap<object, unknown>` | |
| WeakSet | ` WeakSet<object>` | |
| Promise | ` Promise<unknown>` | |
19 changes: 19 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.24-alpha/api/keyof.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
hide_table_of_contents: true
---

# keyOf

## operator

- [keyOf](./keyof.md)

## tuple

- "["keyOf", T]" <br/>
- const tupleKeyOf = type(["keyOf", {a:"string"}])<br/>

## helper

- keyOf(T) <br/>
- const helperKeyOf = keyOf({a:"string"})<br/>
Loading

0 comments on commit 00eb82f

Please sign in to comment.