Skip to content

Commit

Permalink
chore: update versions (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 12, 2024
1 parent 2fc581f commit fe1623b
Show file tree
Hide file tree
Showing 56 changed files with 1,455 additions and 9 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.29-alpha

### Patch Changes

- fix: don't freeze definitions for compatibility with sass

## 1.0.28-alpha

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion dev/arktype.io/docs/api/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export declare class Scope<context extends ScopeContext = any> {
aliases: Dict
name: string
config: ScopeConfig
parseCache: FreezingCache<Node>
parseCache: Cache<Node>
constructor(aliases: Dict, opts?: ScopeOptions)
getAnonymousQualifiedName(base: AnonymousTypeName): QualifiedTypeName
addAnonymousTypeReference(referencedType: Type, ctx: ParseContext): Node
Expand Down
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.28-alpha"
arktype: "1.0.29-alpha"
},
settings: {
compile: {
Expand Down
2 changes: 1 addition & 1 deletion dev/arktype.io/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { StackBlitzDemo } from "./demos/StackBlitzDemo.tsx"
<sub>(or whatever package manager you prefer)</sub>
<br />

Our types are tested in [strict-mode](https://www.typescriptlang.org/tsconfig#strict) with TypeScript versions `4.8`, `4.9`, and `5.0`.
Our types are tested in [strict-mode](https://www.typescriptlang.org/tsconfig#strict) with TypeScript version `4.8` or greater.

_Our APIs have mostly stabilized, but details may still change during the alpha/beta stages of our 1.0 release. If you have suggestions that may require a breaking change, now is the time to let us know!_

Expand Down
15 changes: 15 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.29-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.29-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.29-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) => Out<number>
parsedInteger: (In: string) => Out<number>
parsedDate: (In: string) => Out<Date>
semver: string
json: (In: string) => Out<unknown>
integer: number
},
{},
false
]
>
```
24 changes: 24 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.29-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.29-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.29-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/>
56 changes: 56 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.29-alpha/api/keywords.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
hide_table_of_contents: true
---

# Keywords

## jsObjectsScope

| 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>` | |

## tsKeywordsScope

| Name | Type | Description |
| --------- | ------------ | ----------- |
| any | ` any` | any |
| bigint | ` bigint` | a bigint |
| boolean | ` boolean` | a boolean |
| false | ` false` | false |
| never | ` never` | never |
| null | ` null` | null |
| number | ` number` | a number |
| object | ` object` | an object |
| string | ` string` | a string |
| symbol | ` symbol` | a symbol |
| true | ` true` | true |
| unknown | ` unknown` | unknown |
| void | ` void` | void |
| undefined | ` undefined` | undefined |

## validationScope

| Name | Type | Description |
| ------------- | ------------------------------------------------------------------ | ---------------------------- |
| alpha | ` string` | only letters |
| alphanumeric | ` string` | only letters and digits |
| lowercase | ` string` | only lowercase letters |
| uppercase | ` string` | only uppercase letters |
| creditCard | ` string` | a valid credit card number |
| email | ` string` | a valid email |
| uuid | ` string` | a valid UUID |
| parsedNumber | ` (In: string) => import("../../parse/ast/morph.js").Out<number>` | a well-formed numeric string |
| parsedInteger | ` (In: string) => import("../../parse/ast/morph.js").Out<number>` | a well-formed integer string |
| parsedDate | ` (In: string) => import("../../parse/ast/morph.js").Out<Date>` | a valid date |
| semver | ` string` | a valid semantic version |
| json | ` (In: string) => import("../../parse/ast/morph.js").Out<unknown>` | a JSON-parsable string |
| integer | ` number` | an integer |
19 changes: 19 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.29-alpha/api/morph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
hide_table_of_contents: true
---

# morph

## operator

- [&vert;>](./morph.md)

## tuple

- [inputType, "&vert;>", (data) => output] <br/>
- const tupleMorph = type( ["string", "&vert;>" , (data) => \`morphed ${data}\`])<br/>

## helper

- morph(inputType, (data) => output) <br/>
- const helperMorph = morph("string", (data) => \`morphed ${data}\`)<br/>
18 changes: 18 additions & 0 deletions dev/arktype.io/versioned_docs/version-1.0.29-alpha/api/narrow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_table_of_contents: true
---

# narrow

## operator

- [=>](./narrow.md)

## tuple

- ["type", "=>" , condition] <br/>
- const narrow = type( ["number", "=>" , (n) => n % 2 === 0])<br/>

## example

- const isEven = (x: unknown): x is number => x % 2 === 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
hide_table_of_contents: true
---

# Operators

## Operating Table

| operator | string | tuple | helper |
| ----------------------------- | ---------------------------------------------------------- | ---------------------------------------- | ---------------------------------- |
| [arrayOf](./arrayof.md) | "T[]" | [T, "[]"] | arrayOf(T) |
| [instanceOf](./instanceof.md) | | ["instanceOf", T] | instanceOf(T) |
| [&](./intersection.md) | "L&R" | [L, "&", R] | intersection(L,R) |
| [keyOf](./keyof.md) | | "["keyOf", T]" | keyOf(T) |
| [&vert;>](./morph.md) | | [inputType, "&vert;>", (data) => output] | morph(inputType, (data) => output) |
| [=>](./narrow.md) | | ["type", "=>" , condition] | |
| [&vert;](./union.md) | "L&vert;R" | [L, "&vert;" , R] | union(L,R) |
| [===](./valueof.md) | | ["===", T] | valueOf(T) |
| [:](./parseconfigtuple.md) | | ["type", ":", config] | |
| [bound](./validatebound.md) | "N<S<N", with comparators restricted to < or <= | | |
| [%](./validatedivisor.md) | "N%D", where "N" is a number and "D" is a non-zero integer | | |
| [node](./resolvednode.md) | | ["node", nodeDefinition] | type.from(nodeDefinition) |
Loading

0 comments on commit fe1623b

Please sign in to comment.