@alloy-js/json 0.26.0 → 0.27.0-dev.1

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.
@@ -12,12 +12,7 @@ Create a JSON object by providing children that define the object’s contents.
12
12
  import { JsonObject } from "@alloy-js/json";
13
13
 
14
14
 
15
- <JsonObject
16
- refkey={Refkey | Refkey[]}
17
- style={{
18
- concise?: boolean;
19
- }}
20
- >
15
+ <JsonObject refkey={Refkey | Refkey[]} style={{ concise?: boolean }}>
21
16
  {children}
22
17
  </JsonObject>
23
18
  ```
@@ -30,9 +25,7 @@ Create a JSON object by providing children that define the object’s contents.
30
25
 
31
26
  JsonObject({
32
27
  refkey: Refkey | Refkey[],
33
- style: {
34
- concise?: boolean;
35
- },
28
+ style: { concise?: boolean },
36
29
  }).children(children)
37
30
  ```
38
31
 
@@ -42,7 +35,7 @@ Create a JSON object by providing children that define the object’s contents.
42
35
  | -------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
43
36
  | children | [Children](../../../core/types/children/) | The contents of the JSON object. Likely to contain [JsonObjectProperty](../jsonobjectproperty/) components. |
44
37
  | refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for the JSON object. When provided, this value can be referenced elsewhere via this refkey. |
45
- | style | optional { concise?: boolean; } | |
38
+ | style | optional { concise?: boolean } | |
46
39
 
47
40
  ## Overload 2
48
41
 
@@ -55,11 +48,9 @@ Create a JSON object by providing a JS value that will be serialized to JSON.
55
48
 
56
49
 
57
50
  <JsonObject
58
- jsValue={[string, unknown][] | Map<string, unknown> | Record<string, unknown>}
51
+ jsValue={Record<string, unknown> | Map<string, unknown> | [string, unknown][]}
59
52
  refkey={Refkey | Refkey[]}
60
- style={{
61
- concise?: boolean;
62
- }}
53
+ style={{ concise?: boolean }}
63
54
  />
64
55
  ```
65
56
 
@@ -70,11 +61,9 @@ Create a JSON object by providing a JS value that will be serialized to JSON.
70
61
 
71
62
 
72
63
  JsonObject({
73
- jsValue: [string, unknown][] | Map<string, unknown> | Record<string, unknown>,
64
+ jsValue: Record<string, unknown> | Map<string, unknown> | [string, unknown][],
74
65
  refkey: Refkey | Refkey[],
75
- style: {
76
- concise?: boolean;
77
- },
66
+ style: { concise?: boolean },
78
67
  }).children(children)
79
68
  ```
80
69
 
@@ -82,10 +71,10 @@ Create a JSON object by providing a JS value that will be serialized to JSON.
82
71
 
83
72
  | | | |
84
73
  | ------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
85
- | jsValue | \[string, unknown]\[] \| Map\<string, unknown> \| Record\<string, unknown> | The JS value to serialize to JSON. This can be an array of key-value pairs, a map, or a vanilla JS object. |
74
+ | jsValue | Record\<string, unknown> \| Map\<string, unknown> \| \[string, unknown]\[] | The JS value to serialize to JSON. This can be an array of key-value pairs, a map, or a vanilla JS object. |
86
75
  | refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for the JSON object. When provided, this value can be referenced elsewhere via this refkey. |
87
- | style | optional { concise?: boolean; } | |
76
+ | style | optional { concise?: boolean } | |
88
77
 
89
78
  ## See also
90
79
 
91
- * \[unresolved link]
80
+ * @alloy-js/core#MemberScopeContext
@@ -3,7 +3,7 @@
3
3
  Provides information about the current JSON source file. This context is used to allow references between JSON files.
4
4
 
5
5
  ```ts
6
- const JsonFileContext: ComponentContext<JsonFileContext>
6
+ const JsonFileContext: ComponentContext<JsonFileContext>;
7
7
  ```
8
8
 
9
9
  ## Accessor
@@ -5,4 +5,4 @@
5
5
  | | | |
6
6
  | ------ | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
7
7
  | refkey | optional[Refkey](../../../core/types/refkey/) \| [Refkey](../../../core/types/refkey/)\[] | The refkey or array of refkeys for the JSON object. When provided, this value can be referenced elsewhere via this refkey. |
8
- | style | optional { concise?: boolean; } | |
8
+ | style | optional { concise?: boolean } | |
@@ -6,11 +6,12 @@ JsonOutputSymbol is created for JSON Values with a refkey. For JSON objects and
6
6
 
7
7
  Extends [OutputSymbol](../../../core/types/outputsymbol/)
8
8
 
9
- | | | |
10
- | ------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
11
- | constructor | (name: string, spaces: OutputSpace\[] \| OutputSpace \| undefined, options: CreateJsonSymbolOptions) | Constructs a new instance of the [`JsonOutputSymbol`](JsonOutputSymbol.md) class |
12
- | copy | () => JsonOutputSymbol | |
13
- | debugInfo | Record\<string, unknown> | |
14
- | jsonFlags | [JsonSymbolFlags](../../variables/jsonsymbolflags/) | |
15
- | memberSpaces | readonly \[“static”] | |
16
- | staticMembers | import(“@alloy-js/core”).[OutputMemberSpace](../../../core/types/outputmemberspace/) | |
9
+ | | | |
10
+ | ------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | constructor | (name: string, spaces: OutputSpace \| OutputSpace\[] \| undefined, options?: CreateJsonSymbolOptions) | |
12
+ | memberSpaces | readonly \[“static”] | The member space keys for this symbol type. Subclasses override this to declare which member spaces are created on construction (e.g., `["static", "instance"]`). |
13
+ | debugInfo | Record\<string, unknown> | |
14
+ | jsonFlags | [JsonSymbolFlags](../../variables/jsonsymbolflags/) | |
15
+ | staticMembers | [OutputMemberSpace](../../../core/types/outputmemberspace/) | |
16
+ | copy | () => JsonOutputSymbol | Create a clone of this symbol whose name and flags reactively track the original. |
17
+ | Indexer | \[key: number]: () => string | |
@@ -1,5 +1,9 @@
1
1
  # JsonSymbolFlags
2
2
 
3
3
  ```ts
4
- enum JsonSymbolFlags
4
+ enum JsonSymbolFlags {
5
+ None = 0,
6
+ Object = 1,
7
+ Array = 2
8
+ }
5
9
  ```
@@ -1,3 +1,3 @@
1
1
  # json — variables
2
2
 
3
- - [JsonSymbolFlags](JsonSymbolFlags.md) — enum JsonSymbolFlags
3
+ - [JsonSymbolFlags](JsonSymbolFlags.md) — enum JsonSymbolFlags {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alloy-js/json",
3
- "version": "0.26.0",
3
+ "version": "0.27.0-dev.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,23 +23,21 @@
23
23
  "author": "brian.terlson@microsoft.com",
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "pathe": "^2.0.3",
27
- "@alloy-js/core": "~0.26.0"
26
+ "@alloy-js/core": "~0.26.0 || >= 0.27.0-dev.1",
27
+ "pathe": "^2.0.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@microsoft/api-extractor": "~7.58.8",
30
+ "@alloy-js/cli": "~0.26.0 || >= 0.27.0-dev.0",
31
+ "@alloy-js/rollup-plugin": "~0.2.0 || >= 0.2.1-dev.0",
31
32
  "@rollup/plugin-typescript": "^12.3.0",
32
33
  "@types/node": "^26.1.1",
33
34
  "concurrently": "^10.0.3",
34
35
  "typescript": "^7.0.2",
35
- "vitest": "4.1.10",
36
- "@alloy-js/cli": "~0.26.0",
37
- "@alloy-js/rollup-plugin": "~0.2.0"
36
+ "vitest": "4.1.10"
38
37
  },
39
38
  "type": "module",
40
39
  "scripts": {
41
- "generate-docs": "api-extractor run",
42
- "build": "alloy build --with-dev && pnpm run generate-docs",
40
+ "build": "alloy build --with-dev",
43
41
  "clean": "rimraf dist/ .temp/",
44
42
  "test:watch": "vitest -w",
45
43
  "watch": "alloy build --watch",
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../api-extractor.base.json"
4
- }