Skip to content

Commit

Permalink
chore: correct docs, set as async
Browse files Browse the repository at this point in the history
  • Loading branch information
Caele committed Dec 14, 2020
1 parent 2851042 commit fc12c73
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
14 changes: 9 additions & 5 deletions apis/nucleus/src/index.js
Expand Up @@ -267,9 +267,9 @@ function nuked(configuration = {}) {
},
/**
* Gets the app selections of this instance.
* @returns {AppSelections}
* @returns {Promise<AppSelections>}
* @example
* const selections = n.selections();
* const selections = await n.selections();
* selections.mount(element);
*/
selections: async () => {
Expand Down Expand Up @@ -312,17 +312,19 @@ function nuked(configuration = {}) {
},
/**
* Gets the instance of the specified field
* @returns {FieldSelections}
* @param {string} fieldName
* @returns {Promise<FieldSelections>}
* @experimental
* @example
* const field = await n.selections();
* const field = await n.field("MyField");
* field.mount(element, { title: "Hello Field"});
*/
field: (fieldName) => {
field: async (fieldName) => {
/**
* @class
* @hideconstructor
* @alias FieldSelections
* @experimental
*/
const fieldSels = {
fieldName,
Expand All @@ -334,6 +336,7 @@ function nuked(configuration = {}) {
* @param {string=} [options.direction=ltr] Direction setting ltr|rtl.
* @param {string=} [options.listLayout=vertical] Layout direction vertical|horizontal
* @param {boolean=} [options.search=true] To show the search bar
* @experimental
* @example
* field.mount(element);
*/
Expand All @@ -354,6 +357,7 @@ function nuked(configuration = {}) {
},
/**
* Unmounts the field listbox from the DOM.
* @experimental
* @example
* field.unmount();
*/
Expand Down
28 changes: 23 additions & 5 deletions apis/stardust/api-spec/spec.json
Expand Up @@ -653,11 +653,21 @@
"description": "Gets the instance of the specified field",
"stability": "experimental",
"kind": "function",
"params": [],
"params": [
{
"name": "fieldName",
"type": "string"
}
],
"returns": {
"type": "#/definitions/FieldSelections"
"type": "Promise",
"generics": [
{
"type": "#/definitions/FieldSelections"
}
]
},
"examples": ["const field = await n.selections();\nfield.mount(element, { title: \"Hello Field\"});"]
"examples": ["const field = await n.field(\"MyField\");\nfield.mount(element, { title: \"Hello Field\"});"]
},
"render": {
"description": "Renders a visualization into an HTMLElement.",
Expand Down Expand Up @@ -697,9 +707,14 @@
"kind": "function",
"params": [],
"returns": {
"type": "#/definitions/AppSelections"
"type": "Promise",
"generics": [
{
"type": "#/definitions/AppSelections"
}
]
},
"examples": ["const selections = n.selections();\nselections.mount(element);"]
"examples": ["const selections = await n.selections();\nselections.mount(element);"]
}
}
},
Expand All @@ -722,6 +737,7 @@
"type": "any"
},
"FieldSelections": {
"stability": "experimental",
"kind": "class",
"constructor": {
"kind": "function",
Expand All @@ -731,6 +747,7 @@
"staticEntries": {
"mount": {
"description": "Mounts the field as a listbox into the provided HTMLElement.",
"stability": "experimental",
"kind": "function",
"params": [
{
Expand Down Expand Up @@ -773,6 +790,7 @@
},
"unmount": {
"description": "Unmounts the field listbox from the DOM.",
"stability": "experimental",
"kind": "function",
"params": [],
"examples": ["field.unmount();"]
Expand Down

0 comments on commit fc12c73

Please sign in to comment.