Skip to content

Commit

Permalink
chore: make spec compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
Caele committed Apr 7, 2021
1 parent 092d324 commit 3bfbb57
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 30 deletions.
1 change: 0 additions & 1 deletion apis/locale/src/translator.js
Expand Up @@ -10,7 +10,6 @@ export default function translator({ initial = 'en-US', fallback = 'en-US' } = {

/**
* @class Translator
* @hideconstructor
*/
const api = /** @lends Translator# */ {
language: (lang) => {
Expand Down
1 change: 0 additions & 1 deletion apis/nucleus/src/hooks/useAppSelections.js
Expand Up @@ -59,7 +59,6 @@ function createAppSelections({ app, currentSelectionsLayout, navState }) {

/**
* @class
* @hideconstructor
* @alias AppSelections
*/
const appSelections = {
Expand Down
1 change: 0 additions & 1 deletion apis/nucleus/src/hooks/useObjectSelections.js
Expand Up @@ -23,7 +23,6 @@ function createObjectSelections({ appSelections, appModal, model }) {
/**
* @class
* @alias ObjectSelections
* @hideconstructor
*/
const api = /** @lends ObjectSelections# */ {
// model,
Expand Down
2 changes: 0 additions & 2 deletions apis/nucleus/src/index.js
Expand Up @@ -193,7 +193,6 @@ function nuked(configuration = {}) {
/**
* @class
* @alias Embed
* @hideconstructor
*/
const api = /** @lends Embed# */ {
/**
Expand Down Expand Up @@ -329,7 +328,6 @@ function nuked(configuration = {}) {

/**
* @class
* @hideconstructor
* @alias FieldInstance
* @experimental
* @since 1.1.0
Expand Down
1 change: 0 additions & 1 deletion apis/nucleus/src/viz.js
Expand Up @@ -37,7 +37,6 @@ export default function viz({ model, halo, initialError, onDestroy = async () =>
/**
* @class
* @alias Viz
* @hideconstructor
* @classdesc A controller to further modify a visualization after it has been rendered.
* @example
* const viz = await embed(app).render({
Expand Down
94 changes: 71 additions & 23 deletions apis/stardust/api-spec/spec.json
Expand Up @@ -95,7 +95,7 @@
]
},
"useEffect": {
"description": "Triggers a callback function when a dependant value changes.",
"description": "Triggers a callback function when a dependent value changes.",
"kind": "function",
"params": [
{
Expand All @@ -105,7 +105,7 @@
},
{
"name": "deps",
"description": "The dependencies which should trigger the callback.",
"description": "The dependencies that should trigger the callback.",
"optional": true,
"kind": "array",
"items": {
Expand All @@ -118,7 +118,7 @@
]
},
"useMemo": {
"description": "Creates a stateful value when a dependant changes.",
"description": "Creates a stateful value when a dependent changes.",
"templates": [
{
"name": "T"
Expand Down Expand Up @@ -153,7 +153,7 @@
]
},
"usePromise": {
"description": "Runs a callback function when a dependant changes.",
"description": "Runs a callback function when a dependent changes.",
"templates": [
{
"name": "P"
Expand Down Expand Up @@ -353,6 +353,18 @@
"import { useTranslator } from '@nebula.js/stardust';\n// ...\nconst translator = useTranslator();\nconsole.log(translator.get('SomeString'));"
]
},
"useDeviceType": {
"description": "Gets the device type. ('touch' or 'desktop')",
"kind": "function",
"params": [],
"returns": {
"description": "device type.",
"type": "string"
},
"examples": [
"import { useDeviceType } from '@nebula.js/stardust';\n// ...\nconst deviceType = useDeviceType();\nif (deviceType === 'touch') { ... };"
]
},
"useAction": {
"description": "Registers a custom action.",
"templates": [
Expand Down Expand Up @@ -450,15 +462,15 @@
"optional": true,
"kind": "object",
"entries": {
"select": {
"active": {
"optional": true,
"type": "boolean"
},
"active": {
"passive": {
"optional": true,
"type": "boolean"
},
"passive": {
"select": {
"optional": true,
"type": "boolean"
}
Expand All @@ -473,6 +485,11 @@
"optional": true,
"defaultValue": "en-US",
"type": "string"
},
"deviceType": {
"optional": true,
"defaultValue": "auto",
"type": "string"
}
}
},
Expand Down Expand Up @@ -512,13 +529,20 @@
"flags": {
"type": "#/definitions/Flags"
},
"deviceType": {
"type": "string"
},
"anything": {
"type": "object"
}
}
},
"Embed": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"render": {
"description": "Renders a visualization into an HTMLElement.",
Expand Down Expand Up @@ -631,6 +655,10 @@
"since": "1.1.0"
},
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {},
"staticEntries": {
"mount": {
Expand Down Expand Up @@ -705,7 +733,7 @@
"type": "string"
},
"load": {
"description": "A function that should return a Promise that resolve to a raw JSON theme",
"description": "A function that should return a Promise that resolves to a raw JSON theme.",
"kind": "function",
"params": [],
"returns": {
Expand All @@ -722,19 +750,23 @@
"Viz": {
"description": "A controller to further modify a visualization after it has been rendered.",
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"id": {
"description": "The id of this visualization's generic object.",
"type": "string"
},
"destroy": {
"description": "Destroys the visualization and removes if from the the DOM.",
"description": "Destroys the visualization and removes it from the the DOM.",
"kind": "function",
"params": [],
"examples": ["const viz = await embed(app).render({\n element,\n id: 'abc'\n});\nviz.destroy();"]
},
"convertTo": {
"description": "Converts the visualization to a different registred type",
"description": "Converts the visualization to a different registered type",
"stability": "experimental",
"availability": {
"since": "1.1.0"
Expand All @@ -743,7 +775,7 @@
"params": [
{
"name": "newType",
"description": "Which registered type to convert to",
"description": "Which registered type to convert to.",
"type": "string"
},
{
Expand All @@ -754,7 +786,7 @@
}
],
"returns": {
"description": "Promise object that resolves to the full property tree of the converted visualizatiom",
"description": "Promise object that resolves to the full property tree of the converted visualization.",
"type": "Promise",
"generics": [
{
Expand Down Expand Up @@ -791,6 +823,10 @@
},
"AppSelections": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"mount": {
"description": "Mounts the app selection UI into the provided HTMLElement.",
Expand All @@ -813,6 +849,10 @@
},
"ObjectSelections": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"begin": {
"kind": "function",
Expand Down Expand Up @@ -1501,6 +1541,10 @@
},
"Translator": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"add": {
"description": "Registers a string in multiple locales",
Expand Down Expand Up @@ -1532,17 +1576,17 @@
]
},
"get": {
"description": "Translates a string for current locale",
"description": "Translates a string for current locale.",
"kind": "function",
"params": [
{
"name": "str",
"description": "Id of the registered string",
"description": "ID of the registered string.",
"type": "string"
},
{
"name": "args",
"description": "Values passed down for string interpolation",
"description": "Values passed down for string interpolation.",
"optional": true,
"kind": "array",
"items": {
Expand All @@ -1551,14 +1595,18 @@
}
],
"returns": {
"description": "The translated string",
"description": "The translated string.",
"type": "string"
}
}
}
},
"Theme": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"getDataColorScales": {
"kind": "function",
Expand Down Expand Up @@ -1639,22 +1687,22 @@
"examples": ["theme.getContrastingColorTo('#400');"]
},
"getStyle": {
"description": "Get the value of a style attribute in the theme by searching in the theme's json structure.\nThe search starts at the specified base path and continue upwards until the value is found.\nIf possible it will get the attribute's value using the given path.",
"description": "Get the value of a style attribute in the theme by searching in the theme's JSON structure.\nThe search starts at the specified base path and continues upwards until the value is found.\nIf possible it will get the attribute's value using the given path.",
"kind": "function",
"params": [
{
"name": "basePath",
"description": "Base path in the theme's json structure to start the search in (specified as a name path separated by dots)",
"description": "Base path in the theme's JSON structure to start the search in (specified as a name path separated by dots).",
"type": "string"
},
{
"name": "path",
"description": "Expected path for the attribute (specified as a name path separated by dots)",
"description": "Expected path for the attribute (specified as a name path separated by dots).",
"type": "string"
},
{
"name": "attribute",
"description": "Name of the style attribute",
"description": "Name of the style attribute.",
"type": "string"
}
],
Expand Down Expand Up @@ -1779,7 +1827,7 @@
}
},
"ExportFormat": {
"description": "Used for exporting and importing properties between backend models. An object that exports to\nExportFormat should put dimensions and measures inside one data group. If an object has two hypercubes\neach of the cubes should export dimensions and measures in two separate data groups.\nAn object that imports from this structure is responsible for putting the existing properties where they should be\nin the new model.",
"description": "Used for exporting and importing properties between backend models. An object that exports to\nExportFormat should put dimensions and measures inside one data group. If an object has two hypercubes,\neach of the cubes should export dimensions and measures in two separate data groups.\nAn object that imports from this structure is responsible for putting the existing properties where they should be\nin the new model.",
"stability": "experimental",
"availability": {
"since": "1.1.0"
Expand Down Expand Up @@ -1859,15 +1907,15 @@
}
},
"Conversion": {
"description": "Provides conversion functionality to extensions",
"description": "Provides conversion functionality to extensions.",
"stability": "experimental",
"availability": {
"since": "1.1.0"
},
"kind": "interface",
"entries": {
"hypercube": {
"description": "Provides conversion functionality for extensions with hyperCubes",
"description": "Provides conversion functionality to extensions with hyperCubes.",
"stability": "experimental",
"availability": {
"since": "1.1.0"
Expand Down
1 change: 0 additions & 1 deletion apis/theme/src/index.js
Expand Up @@ -17,7 +17,6 @@ export default function theme() {
/**
* @class
* @alias Theme
* @hideconstructor
*/
const externalAPI = /** @lends Theme# */ {
/**
Expand Down

0 comments on commit 3bfbb57

Please sign in to comment.