Extend WrapperKeepOpaque with optional decoding (#4422)

* Extend WrapperKeepOpaque with optional decoding

* headers

* TypeDefInfo.WrapperKeepOpaque

* Rebuild

* CHANGELOG
This commit is contained in:
Jaco
2022-01-07 12:36:28 +02:00
committed by GitHub
parent 763e73138a
commit a9b0f97f74
66 changed files with 238 additions and 69 deletions
+4
View File
@@ -50,6 +50,7 @@ const tsHashMap = tsExport;
const tsOption = tsExport;
const tsPlain = tsExport;
const tsTuple = tsExport;
const tsWrapperKeepOpaque = tsExport;
const tsWrapperOpaque = tsExport;
/** @internal */
@@ -78,6 +79,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
case TypeDefInfo.Vec:
case TypeDefInfo.Option:
case TypeDefInfo.VecFixed:
case TypeDefInfo.WrapperKeepOpaque:
case TypeDefInfo.WrapperOpaque:
return `${isGetter}${asGetter}`;
@@ -123,6 +125,7 @@ function tsResultGetter (registry: Registry, definitions: Record<string, ModuleT
case TypeDefInfo.Si:
case TypeDefInfo.Tuple:
case TypeDefInfo.Vec:
case TypeDefInfo.WrapperKeepOpaque:
case TypeDefInfo.WrapperOpaque:
return `${isGetter}${asGetter}`;
@@ -240,6 +243,7 @@ export const typeEncoders: Record<TypeDefInfo, (registry: Registry, definitions:
[TypeDefInfo.UInt]: tsUInt,
[TypeDefInfo.Vec]: tsVec,
[TypeDefInfo.VecFixed]: tsVec,
[TypeDefInfo.WrapperKeepOpaque]: tsWrapperKeepOpaque,
[TypeDefInfo.WrapperOpaque]: tsWrapperOpaque
};
+4
View File
@@ -257,6 +257,10 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
return dualParamsNotation(registry, 'Result', typeDef, definitions, imports, withShortcut);
},
[TypeDefInfo.WrapperKeepOpaque]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
return singleParamNotation(registry, 'WrapperKeepOpaque', typeDef, definitions, imports, withShortcut);
},
[TypeDefInfo.WrapperOpaque]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
return singleParamNotation(registry, 'WrapperOpaque', typeDef, definitions, imports, withShortcut);
}