diff --git a/README.md b/README.md index 2b964d1..5a5316a 100644 --- a/README.md +++ b/README.md @@ -379,17 +379,14 @@ interface List { } let recursiveType = new sb.RecursiveType>('linked-list') -sb.registerType({ - type: new sb.StructType>({ - list: new sb.OptionalType( - new sb.StructType>({ - head: new sb.StringType, - tail: recursiveType - }) - ) - }), - name: 'linked-list' -}) +recursiveType.setType(new sb.StructType>({ + list: new sb.OptionalType( + new sb.StructType>({ + head: new sb.StringType, + tail: recursiveType + }) + ) +})) recursiveType.valueBuffer({ list: { head: '1', diff --git a/docs/index.html b/docs/index.html index 1b98460..86141b1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -431,17 +431,14 @@

Using with TypeScript

} let recursiveType = new sb.RecursiveType<List<string>>('linked-list') -sb.registerType({ - type: new sb.StructType<List<string>>({ - list: new sb.OptionalType( - new sb.StructType<Cons<string>>({ - head: new sb.StringType, - tail: recursiveType - }) - ) - }), - name: 'linked-list' -}) +recursiveType.setType(new sb.StructType<List<string>>({ + list: new sb.OptionalType( + new sb.StructType<Cons<string>>({ + head: new sb.StringType, + tail: recursiveType + }) + ) +})) recursiveType.valueBuffer({ list: { head: '1', diff --git a/docs/modules/_index_.html b/docs/modules/_index_.html index 94ddf10..6916c3b 100644 --- a/docs/modules/_index_.html +++ b/docs/modules/_index_.html @@ -84,7 +84,6 @@

External module "index"

  • From read
  • From recursive-registry