@codama/renderers-rust 1.0.1 → 1.0.3

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.
@@ -0,0 +1,39 @@
1
+ import { AccountNode, DefinedTypeNode } from '@codama/nodes';
2
+ import { ImportMap } from '../ImportMap';
3
+ export type TraitOptions = {
4
+ /** The default traits to implement for all types. */
5
+ baseDefaults?: string[];
6
+ /**
7
+ * The default traits to implement for data enums only — on top of the base defaults.
8
+ * Data enums are enums with at least one non-unit variant.
9
+ */
10
+ dataEnumDefaults?: string[];
11
+ /**
12
+ * The mapping of feature flags to traits.
13
+ * For each entry, the traits will be rendered within a
14
+ * `#[cfg_attr(feature = "feature_name", derive(Traits))]` attribute.
15
+ */
16
+ featureFlags?: Record<string, string[]>;
17
+ /** The complete trait overrides of specific types. */
18
+ overrides?: Record<string, string[]>;
19
+ /**
20
+ * The default traits to implement for scalar enums only — on top of the base defaults.
21
+ * Scalar enums are enums with no variants or only unit variants.
22
+ */
23
+ scalarEnumDefaults?: string[];
24
+ /** The default traits to implement for structs only — on top of the base defaults. */
25
+ structDefaults?: string[];
26
+ /** Whether or not to use the fully qualified name for traits, instead of importing them. */
27
+ useFullyQualifiedName?: boolean;
28
+ };
29
+ export declare const DEFAULT_TRAIT_OPTIONS: Required<TraitOptions>;
30
+ export type GetTraitsFromNodeFunction = (node: AccountNode | DefinedTypeNode) => {
31
+ imports: ImportMap;
32
+ render: string;
33
+ };
34
+ export declare function getTraitsFromNodeFactory(options?: TraitOptions): GetTraitsFromNodeFunction;
35
+ export declare function getTraitsFromNode(node: AccountNode | DefinedTypeNode, userOptions?: TraitOptions): {
36
+ imports: ImportMap;
37
+ render: string;
38
+ };
39
+ //# sourceMappingURL=traitOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traitOptions.d.ts","sourceRoot":"","sources":["../../../src/utils/traitOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2B,eAAe,EAAwB,MAAM,eAAe,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IACvB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,4FAA4F;IAC5F,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAiBxD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,KAAK;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAExH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,YAAiB,GAAG,yBAAyB,CAE9F;AAED,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,WAAW,GAAG,eAAe,EACnC,WAAW,GAAE,YAAiB,GAC/B;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAqCxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codama/renderers-rust",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Renders Rust clients for your programs",
5
5
  "exports": {
6
6
  "types": "./dist/types/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@solana/codecs-strings": "rc",
32
32
  "nunjucks": "^3.2.4",
33
- "@codama/errors": "1.0.0",
34
33
  "@codama/nodes": "1.0.0",
35
34
  "@codama/renderers-core": "1.0.0",
35
+ "@codama/errors": "1.0.0",
36
36
  "@codama/visitors-core": "1.0.0"
37
37
  },
38
38
  "devDependencies": {