Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Nov 29, 2023
1 parent af0dc2a commit 5985977
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 67 deletions.
46 changes: 7 additions & 39 deletions docs/modules/Serializable.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ Serializable represents an object that has self-contained Schema(s)
- [successSchema](#successschema)
- [model](#model)
- [Serializable (interface)](#serializable-interface)
- [Serializable (namespace)](#serializable-namespace)
- [Schemas (interface)](#schemas-interface)
- [SerializableWithResult (interface)](#serializablewithresult-interface)
- [SerializableWithResult (namespace)](#serializablewithresult-namespace)
- [Schemas (interface)](#schemas-interface-1)
- [symbol](#symbol)
- [symbol](#symbol-1)
- [symbolResult](#symbolresult)
Expand Down Expand Up @@ -71,23 +67,9 @@ Added in v1.0.0
```ts
export interface Serializable {
readonly [symbol]: Serializable.Schemas
}
```

Added in v1.0.0

## Serializable (namespace)

Added in v1.0.0

### Schemas (interface)

**Signature**

```ts
export interface Schemas {
readonly Self: Schema.Schema<unknown, any>
readonly [symbol]: {
readonly Self: Schema.Schema<unknown, any>
}
}
```

Expand All @@ -99,24 +81,10 @@ Added in v1.0.0

```ts
export interface SerializableWithResult extends Serializable {
readonly [symbolResult]: SerializableWithResult.Schemas
}
```

Added in v1.0.0

## SerializableWithResult (namespace)

Added in v1.0.0

### Schemas (interface)

**Signature**

```ts
export interface Schemas {
readonly Failure: Schema.Schema<unknown, any>
readonly Success: Schema.Schema<unknown, any>
readonly [symbolResult]: {
readonly Failure: Schema.Schema<unknown, any>
readonly Success: Schema.Schema<unknown, any>
}
}
```

Expand Down
15 changes: 15 additions & 0 deletions docs/modules/index.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Added in v1.0.0
- [From "./Parser.js"](#from-parserjs)
- [From "./Pretty.js"](#from-prettyjs)
- [From "./Schema.js"](#from-schemajs)
- [From "./Serializable.js"](#from-serializablejs)
- [From "./TreeFormatter.js"](#from-treeformatterjs)

---
Expand Down Expand Up @@ -136,6 +137,20 @@ export * as Schema from "./Schema.js"

Added in v1.0.0

## From "./Serializable.js"

Re-exports all named exports from the "./Serializable.js" module as `Serializable`.

**Signature**

```ts
export * as Serializable from "./Serializable.js"
```

Added in v1.0.0

Serializable represents an object that has self-contained Schema(s)

## From "./TreeFormatter.js"

Re-exports all named exports from the "./TreeFormatter.js" module as `TreeFormatter`.
Expand Down
32 changes: 4 additions & 28 deletions src/Serializable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@ import type * as Schema from "./Schema.js"
* @since 1.0.0
* @category symbol
*/
export const symbol: unique symbol = Symbol.for("@effect/schema/Serializable")
export const symbol: unique symbol = Symbol.for("@effect/schema/Serializable/symbol")

/**
* @since 1.0.0
* @category model
*/
export interface Serializable {
readonly [symbol]: Serializable.Schemas
}

/**
* @since 1.0.0
* @category model
*/
export declare namespace Serializable {
/**
* @since 1.0.0
* @category model
*/
export interface Schemas {
readonly [symbol]: {
readonly Self: Schema.Schema<unknown, any>
}
}
Expand All @@ -45,27 +33,15 @@ export const selfSchema = <A extends Serializable>(self: A): A[typeof symbol]["S
* @category symbol
*/
export const symbolResult: unique symbol = Symbol.for(
"@effect/schema/Serializable/SerializableResult"
"@effect/schema/Serializable/symbolResult"
)

/**
* @since 1.0.0
* @category model
*/
export interface SerializableWithResult extends Serializable {
readonly [symbolResult]: SerializableWithResult.Schemas
}

/**
* @since 1.0.0
* @category model
*/
export declare namespace SerializableWithResult {
/**
* @since 1.0.0
* @category model
*/
export interface Schemas {
readonly [symbolResult]: {
readonly Failure: Schema.Schema<unknown, any>
readonly Success: Schema.Schema<unknown, any>
}
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export * as Pretty from "./Pretty.js"
*/
export * as Schema from "./Schema.js"

/**
* @since 1.0.0
*
* Serializable represents an object that has self-contained Schema(s)
*/
export * as Serializable from "./Serializable.js"

/**
* @since 1.0.0
*/
Expand Down

0 comments on commit 5985977

Please sign in to comment.