-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3cfb7a
commit 83011d6
Showing
11 changed files
with
585 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const td = require("typedoc"); | ||
const ts = td.TypeScript; | ||
|
||
/** @param {td.Application} app */ | ||
exports.load = function (app) { | ||
// Add decorator info to reflections | ||
// if you need parameters, you need app.converter.on(td.Converter.EVENT_CREATE_PARAMETER) | ||
app.converter.on(td.Converter.EVENT_CREATE_DECLARATION, addDecoratorInfo); | ||
|
||
// Add decorator info to serialized json | ||
app.serializer.addSerializer({ | ||
priority: 0, | ||
supports(item) { | ||
return item instanceof td.DeclarationReflection; | ||
}, | ||
toObject(item, obj, _ser) { | ||
if (item.decorators) { | ||
obj.decorators = item.decorators; | ||
} | ||
return obj; | ||
}, | ||
}); | ||
}; | ||
|
||
/** | ||
* @param {td.Context} context | ||
* @param {td.DeclarationReflection} decl | ||
*/ | ||
function addDecoratorInfo(context, decl) { | ||
const symbol = context.project.getSymbolFromReflection(decl); | ||
if (!symbol) { | ||
return; | ||
} | ||
const declaration = symbol.valueDeclaration; | ||
if (!declaration) { | ||
return; | ||
} | ||
if (!ts.isPropertyDeclaration(declaration) && !ts.isMethodDeclaration(declaration)) { | ||
return; | ||
} | ||
|
||
const decorators = declaration.modifiers?.filter(ts.isDecorator); | ||
decl.decorators = decorators?.map((d) => { | ||
return { | ||
expression: d.getText(), | ||
escapedText: d.expression.expression.escapedText, | ||
}; | ||
}); | ||
} |
86 changes: 60 additions & 26 deletions
86
packages/ods/src/components/spinner/documentation/specifications/spec.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,60 @@ | ||
* [**Interfaces**](#interfaces) | ||
* [**Types**](#types) | ||
|
||
## Interfaces | ||
|
||
### OdsSpinnerAttribute | ||
|Name | Type | Required | Default | Description| | ||
|---|---|:---:|---|---| | ||
|**`contrasted`** | _boolean_ | | | contrasted or not: see component principles| | ||
|**`inline`** | _boolean_ | | | full width or not: see component principles| | ||
|**`mode`** | `indeterminate` | | | choose between infinite or progress spinner (infinite only for now)| | ||
|**`size`** | `ODS_SPINNER_SIZE` | | | size: see component principles| | ||
|
||
## Types | ||
|
||
### ODS_SPINNER_MODE | ||
| | | ||
|:---:| | ||
| `indeterminate` | | ||
|
||
### ODS_SPINNER_SIZE | ||
| | | ||
|:---:| | ||
| `lg` | | ||
| `md` | | ||
| `sm` | | ||
## Table of Contents | ||
[• Properties](#properties) | ||
|
||
[• Methods](#methods) | ||
|
||
[• Events](#events) | ||
|
||
[• Enums](#enums) | ||
|
||
## Properties | ||
### color | ||
|
||
• **color**: [_primary_] = `ODS_SPINNER_COLOR.primary` | ||
|
||
**Description**: test typedoc comment props | ||
### size | ||
|
||
• **size**: [`sm` | `md` | `lg`] = `ODS_SPINNER_SIZE.md` | ||
|
||
|
||
## Methods | ||
### someMethodTest | ||
|
||
▸ **someMethodTest**(): `Promise`<`string` | `number`> | ||
|
||
**Description**: test typedoc comment methods | ||
|
||
#### Returns | ||
`Promise`<`string` | `number`> | ||
## Events | ||
### focusEvent | ||
|
||
▸ **focusEvent**(): `EventEmitter`<_void_> | ||
|
||
**Description**: test typedoc comment event | ||
|
||
#### Returns | ||
`EventEmitter`<_void_> | ||
## Enums | ||
## Enumeration: ODS_SPINNER_COLOR | ||
|
||
### primary | ||
|
||
• **primary** = `"primary"` | ||
|
||
|
||
## Enumeration: ODS_SPINNER_SIZE | ||
|
||
### lg | ||
|
||
• **lg** = `"lg"` | ||
|
||
### md | ||
|
||
• **md** = `"md"` | ||
|
||
### sm | ||
|
||
• **sm** = `"sm"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.