@fern-api/go-dynamic-snippets 1.64.2 → 1.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -16,6 +16,17 @@ declare class DynamicTypeInstantiationMapper {
16
16
  context: DynamicSnippetsGeneratorContext;
17
17
  });
18
18
  convert(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation;
19
+ /**
20
+ * Follows alias-of-alias hops (e.g. `type B = A`) and unwraps optional/nullable wrappers to
21
+ * find the type an alias ultimately renders as.
22
+ */
23
+ private resolveAliasTarget;
24
+ /**
25
+ * Go cannot take the address of an alias value directly (e.g. `any` or a pointer
26
+ * alias), so a pointer to the alias is materialized through a local variable.
27
+ */
28
+ private convertAliasPointer;
29
+ private unwrapOptionalOrNullable;
19
30
  convertToPointerIfPossible(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation;
20
31
  private convertList;
21
32
  private convertMap;
@@ -119,7 +130,19 @@ declare class DynamicTypeMapper {
119
130
  * Checks if a named type is an alias that already generates as a pointer in Go
120
131
  * (e.g. a nullable primitive like *time.Time). Traverses alias chains.
121
132
  */
122
- private isAliasToPointerType;
133
+ isAliasToPointerType(typeId: FernIr.dynamic.TypeId): boolean;
134
+ /**
135
+ * Returns true if an optional reference to the alias should not add another pointer because
136
+ * the alias already generates as a pointer. With `legacyNullableAliasPointers`, only date and
137
+ * datetime aliases omit the pointer because their fields are marshaled through *time.Time.
138
+ */
139
+ omitsPointerForAlias(typeId: FernIr.dynamic.TypeId): boolean;
140
+ private resolvePointerAliasTarget;
141
+ /**
142
+ * Lists, maps, sets, and unknown values are already nil-able, so an optional/nullable
143
+ * wrapper around them renders without a pointer.
144
+ */
145
+ private isPointerRequiredForOptionalInner;
123
146
  private convertLiteral;
124
147
  private convertNamed;
125
148
  private convertUnknown;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,17 @@ declare class DynamicTypeInstantiationMapper {
16
16
  context: DynamicSnippetsGeneratorContext;
17
17
  });
18
18
  convert(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation;
19
+ /**
20
+ * Follows alias-of-alias hops (e.g. `type B = A`) and unwraps optional/nullable wrappers to
21
+ * find the type an alias ultimately renders as.
22
+ */
23
+ private resolveAliasTarget;
24
+ /**
25
+ * Go cannot take the address of an alias value directly (e.g. `any` or a pointer
26
+ * alias), so a pointer to the alias is materialized through a local variable.
27
+ */
28
+ private convertAliasPointer;
29
+ private unwrapOptionalOrNullable;
19
30
  convertToPointerIfPossible(args: DynamicTypeInstantiationMapper.Args): go.TypeInstantiation;
20
31
  private convertList;
21
32
  private convertMap;
@@ -119,7 +130,19 @@ declare class DynamicTypeMapper {
119
130
  * Checks if a named type is an alias that already generates as a pointer in Go
120
131
  * (e.g. a nullable primitive like *time.Time). Traverses alias chains.
121
132
  */
122
- private isAliasToPointerType;
133
+ isAliasToPointerType(typeId: FernIr.dynamic.TypeId): boolean;
134
+ /**
135
+ * Returns true if an optional reference to the alias should not add another pointer because
136
+ * the alias already generates as a pointer. With `legacyNullableAliasPointers`, only date and
137
+ * datetime aliases omit the pointer because their fields are marshaled through *time.Time.
138
+ */
139
+ omitsPointerForAlias(typeId: FernIr.dynamic.TypeId): boolean;
140
+ private resolvePointerAliasTarget;
141
+ /**
142
+ * Lists, maps, sets, and unknown values are already nil-able, so an optional/nullable
143
+ * wrapper around them renders without a pointer.
144
+ */
145
+ private isPointerRequiredForOptionalInner;
123
146
  private convertLiteral;
124
147
  private convertNamed;
125
148
  private convertUnknown;