You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript typings of latest Schema.org schema, without
@@ -31,13 +31,17 @@ To use the typings for your project, simply add the
31
31
[`schema-dts`](https://www.npmjs.com/package/schema-dts) NPM package to your
32
32
project:
33
33
34
-
npm install schema-dts
34
+
```command
35
+
npm install schema-dts
36
+
```
35
37
36
38
Then you can use it by importing `"schema-dts"`.
37
39
38
40
### Root context
39
41
40
-
You will usually want your top-level item to include a `@context`, like `https://schema.org`. In order for your object type to accept this property, you can augment it with `WithContext`, e.g.:
42
+
You will usually want your top-level item to include a `@context`, like
43
+
`https://schema.org`. In order for your object type to accept this property, you
JSON-LD supports `'@graph'` objects that have richer interconnected links between the nodes. You can do that easily in `schema-dts` by using the `Graph` type.
62
+
JSON-LD supports `'@graph'` objects that have richer interconnected links
63
+
between the nodes. You can do that easily in `schema-dts` by using the `Graph`
64
+
type.
59
65
60
-
Notice that any node can have an `@id` when defining it. And you can reference the same node from different places by simply using an ID stub, for example `{ '@id': 'https://my.site/about/#page }` below is an ID stub.
66
+
Notice that any node can have an `@id` when defining it. And you can reference
67
+
the same node from different places by simply using an ID stub, for example
68
+
`{ '@id': 'https://my.site/about/#page }` below is an ID stub.
61
69
62
-
The example below shows potential JSON-LD for an About page. It includes definitions of Alyssa P. Hacker (the author & subject of the page), the specific page in this URL, and the website it belongs to. Some objects are still defined as inline nested objects (e.g. Occupation), since they are only referenced by their parent. Other objects are defined at the top-level with an `@id`, because multiple nodes refer to them.
70
+
The example below shows potential JSON-LD for an About page. It includes
71
+
definitions of Alyssa P. Hacker (the author & subject of the page), the specific
72
+
page in this URL, and the website it belongs to. Some objects are still defined
73
+
as inline nested objects (e.g. Occupation), since they are only referenced by
74
+
their parent. Other objects are defined at the top-level with an `@id`, because
JSON-LD supports `'@graph'` objects that have richer interconnected links between the nodes. You can do that easily in `schema-dts` by using the `Graph` type.
74
+
JSON-LD supports `'@graph'` objects that have richer interconnected links
75
+
between the nodes. You can do that easily in `schema-dts` by using the `Graph`
76
+
type.
73
77
74
-
Notice that any node can have an `@id` when defining it. And you can reference the same node from different places by simply using an ID stub, for example `{ '@id': 'https://my.site/about/#page }` below is an ID stub.
78
+
Notice that any node can have an `@id` when defining it. And you can reference
79
+
the same node from different places by simply using an ID stub, for example
80
+
`{ '@id': 'https://my.site/about/#page }` below is an ID stub.
75
81
76
-
The example below shows potential JSON-LD for an About page. It includes definitions of Alyssa P. Hacker (the author & subject of the page), the specific page in this URL, and the website it belongs to. Some objects are still defined as inline nested objects (e.g. Occupation), since they are only referenced by their parent. Other objects are defined at the top-level with an `@id`, because multiple nodes refer to them.
82
+
The example below shows potential JSON-LD for an About page. It includes
83
+
definitions of Alyssa P. Hacker (the author & subject of the page), the specific
84
+
page in this URL, and the website it belongs to. Some objects are still defined
85
+
as inline nested objects (e.g. Occupation), since they are only referenced by
86
+
their parent. Other objects are defined at the top-level with an `@id`, because
0 commit comments