thing-contract (TS): list slots name ImmutableArray, as C#
This commit is contained in:
parent
cb3a1e51f7
commit
b9920b20cd
1 changed files with 3 additions and 3 deletions
|
|
@ -25,13 +25,13 @@ const named = (name: string): string => `GameCult.Thing.Contract.${name}`;
|
|||
|
||||
const blob = present(bytes);
|
||||
|
||||
// The C# member type of a list slot is IReadOnlyList<T>; cultcache-ts names only List<T> (a stopgap, until
|
||||
// thing2:follow_up:cultcache-ts-readonly-list-name lands). A list slot is required.
|
||||
// The C# member type of a list slot is ImmutableArray<T>, a whole-value holder; cultcache-ts names only List<T>
|
||||
// (a stopgap, until thing2:follow_up:cultcache-ts-readonly-list-name lands). A list slot is required.
|
||||
const readOnlyList = <TItem>(item: Codec<TItem>): Codec<TItem[]> => {
|
||||
const inner = sequence(item);
|
||||
const readOnly: Codec<TItem[]> = {
|
||||
get typeName() {
|
||||
return item.typeName === undefined ? undefined : `System.Collections.Generic.IReadOnlyList<${item.typeName}>`;
|
||||
return item.typeName === undefined ? undefined : `System.Collections.Immutable.ImmutableArray<${item.typeName}>`;
|
||||
},
|
||||
encode: (value) => inner.encode(value),
|
||||
decode: (raw) => inner.decode(raw),
|
||||
|
|
|
|||
Loading…
Reference in a new issue