diff --git a/api/README.md b/api/README.md index ec614b62..9261970d 100644 --- a/api/README.md +++ b/api/README.md @@ -1,64 +1,94 @@ -**@phun-ky/speccer** • **Docs** +SPECCER logo -*** +# SPECCER API Documentation + +![Speccer hero, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-hero.png?raw=true) -# @phun-ky/speccer +--- + +> Last updated 2024-08-14T10:18:52.237Z ## Modules -- [config/browser](config/browser/README.md) -- [features/a11y](features/a11y/README.md) -- [features/a11y/constants](features/a11y/constants/README.md) -- [features/a11y/utils/styles](features/a11y/utils/styles/README.md) -- [features/dissect](features/dissect/README.md) -- [features/dissect/utils/create](features/dissect/utils/create/README.md) -- [features/dissect/utils/dissect](features/dissect/utils/dissect/README.md) -- [features/dissect/utils/get-character-to-use](features/dissect/utils/get-character-to-use/README.md) -- [features/dissect/utils/styles](features/dissect/utils/styles/README.md) -- [features/grid](features/grid/README.md) -- [features/mark](features/mark/README.md) -- [features/measure](features/measure/README.md) -- [features/spacing](features/spacing/README.md) -- [features/spacing/utils/position](features/spacing/utils/position/README.md) -- [features/typography](features/typography/README.md) -- [features/typography/utils/position](features/typography/utils/position/README.md) -- [features/typography/utils/template](features/typography/utils/template/README.md) -- [main](main/README.md) -- [types/bezier](types/bezier/README.md) -- [types/css](types/css/README.md) -- [types/debounce](types/debounce/README.md) -- [types/enums/area](types/enums/area/README.md) -- [types/interfaces/attributes](types/interfaces/attributes/README.md) -- [types/interfaces/classnames](types/interfaces/classnames/README.md) -- [types/interfaces/global](types/interfaces/global/README.md) -- [types/interfaces/position](types/interfaces/position/README.md) -- [types/position](types/position/README.md) -- [types/speccer](types/speccer/README.md) -- [types/styles](types/styles/README.md) -- [types/xy](types/xy/README.md) -- [utils/angle](utils/angle/README.md) -- [utils/area](utils/area/README.md) -- [utils/attributes](utils/attributes/README.md) -- [utils/bezier](utils/bezier/README.md) -- [utils/camel-case](utils/camel-case/README.md) -- [utils/cardinal](utils/cardinal/README.md) -- [utils/classes/DrawSVGCurlyBracket](utils/classes/DrawSVGCurlyBracket/README.md) -- [utils/classes/DrawSVGLine](utils/classes/DrawSVGLine/README.md) -- [utils/classnames](utils/classnames/README.md) -- [utils/constants](utils/constants/README.md) -- [utils/coords](utils/coords/README.md) -- [utils/css](utils/css/README.md) -- [utils/debounce](utils/debounce/README.md) -- [utils/direction-of-element](utils/direction-of-element/README.md) -- [utils/get-coords-pair-from-objects](utils/get-coords-pair-from-objects/README.md) -- [utils/id](utils/id/README.md) -- [utils/intrinsic-coords](utils/intrinsic-coords/README.md) -- [utils/node](utils/node/README.md) -- [utils/number](utils/number/README.md) -- [utils/position](utils/position/README.md) -- [utils/resize](utils/resize/README.md) -- [utils/style-property](utils/style-property/README.md) -- [utils/styles](utils/styles/README.md) -- [utils/typeof](utils/typeof/README.md) -- [utils/wait](utils/wait/README.md) -- [utils/xy](utils/xy/README.md) +- [config/browser](config/browser.md) +- [features/a11y](features/a11y.md) +- [features/a11y/constants](features/a11y/constants.md) +- [features/a11y/utils/styles](features/a11y/utils/styles.md) +- [features/dissect](features/dissect.md) +- [features/dissect/utils/create](features/dissect/utils/create.md) +- [features/dissect/utils/dissect](features/dissect/utils/dissect.md) +- [features/dissect/utils/get-character-to-use](features/dissect/utils/get-character-to-use.md) +- [features/dissect/utils/styles](features/dissect/utils/styles.md) +- [features/grid](features/grid.md) +- [features/mark](features/mark.md) +- [features/measure](features/measure.md) +- [features/spacing](features/spacing.md) +- [features/spacing/utils/position](features/spacing/utils/position.md) +- [features/typography](features/typography.md) +- [features/typography/utils/position](features/typography/utils/position.md) +- [features/typography/utils/template](features/typography/utils/template.md) +- [main](main.md) +- [types/bezier](types/bezier.md) +- [types/css](types/css.md) +- [types/debounce](types/debounce.md) +- [types/enums/area](types/enums/area.md) +- [types/interfaces/attributes](types/interfaces/attributes.md) +- [types/interfaces/classnames](types/interfaces/classnames.md) +- [types/interfaces/global](types/interfaces/global.md) +- [types/interfaces/position](types/interfaces/position.md) +- [types/position](types/position.md) +- [types/speccer](types/speccer.md) +- [types/styles](types/styles.md) +- [types/xy](types/xy.md) +- [utils/angle](utils/angle.md) +- [utils/area](utils/area.md) +- [utils/attributes](utils/attributes.md) +- [utils/bezier](utils/bezier.md) +- [utils/camel-case](utils/camel-case.md) +- [utils/cardinal](utils/cardinal.md) +- [utils/classes/DrawSVGCurlyBracket](utils/classes/DrawSVGCurlyBracket.md) +- [utils/classes/DrawSVGLine](utils/classes/DrawSVGLine.md) +- [utils/classnames](utils/classnames.md) +- [utils/constants](utils/constants.md) +- [utils/coords](utils/coords.md) +- [utils/css](utils/css.md) +- [utils/debounce](utils/debounce.md) +- [utils/direction-of-element](utils/direction-of-element.md) +- [utils/get-coords-pair-from-objects](utils/get-coords-pair-from-objects.md) +- [utils/id](utils/id.md) +- [utils/intrinsic-coords](utils/intrinsic-coords.md) +- [utils/node](utils/node.md) +- [utils/number](utils/number.md) +- [utils/position](utils/position.md) +- [utils/resize](utils/resize.md) +- [utils/style-property](utils/style-property.md) +- [utils/styles](utils/styles.md) +- [utils/typeof](utils/typeof.md) +- [utils/wait](utils/wait.md) +- [utils/xy](utils/xy.md) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/config/browser.md b/api/config/browser.md new file mode 100644 index 00000000..27aa671d --- /dev/null +++ b/api/config/browser.md @@ -0,0 +1,198 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / config/browser + +# config/browser + +> Last updated 2024-08-14T10:18:52.238Z + +Contains the helper functions to activate SPECCER via a script tag, based on attributes: + +> [!NOTE] +> If the activation method is dom or instant, a resize feature is activated, making sure everything is re-rendered on resize. for manual or lazy loading, you are responsible to handle resize yourself. + +> [!NOTE] +> Remember to add the CSS file!: + +> ```html +> +> ``` + +## Default implementation +```html + +``` + +Makes `window.speccer()` available to be used when you feel like it + +## Initiate immediately +```html + +``` + +fires off `speccer()` right away + +## Initiate when dom ready +```html + +``` + +Waits for `DOMContentLoaded` + +## Initiate with lazy loading +```html + +``` + +Lazy loads `speccer()` per specced element + +## Functions + +### activate() + +```ts +function activate(speccer): void +``` + +A function to activate speccer based on script attributes. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `speccer` | [`SpeccerFunctionType`](../types/speccer.md#speccerfunctiontype) | The speccer function to execute. | + +#### Returns + +`void` + +#### Example + +```ts +// Usage example: +// activate(mySpeccer); +``` + +#### Defined in + +[config/browser.ts:156](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L156) + +*** + +### dom() + +```ts +function dom(speccer): void +``` + +A function to initialize speccer when the DOM is ready. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `speccer` | [`SpeccerFunctionType`](../types/speccer.md#speccerfunctiontype) | The speccer function to execute. | + +#### Returns + +`void` + +#### Example + +```ts +// Usage example: +// dom(mySpeccer); +``` + +#### Defined in + +[config/browser.ts:69](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L69) + +*** + +### lazy() + +```ts +function lazy(): void +``` + +A function to initialize lazy speccer functionality. + +#### Returns + +`void` + +#### Example + +```ts +// Usage example: +// lazy(); +``` + +#### Defined in + +[config/browser.ts:87](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L87) + +*** + +### manual() + +```ts +function manual(speccer): void +``` + +A function to manually activate speccer. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `speccer` | [`SpeccerFunctionType`](../types/speccer.md#speccerfunctiontype) | The speccer function to execute. | + +#### Returns + +`void` + +#### Example + +```ts +// Usage example: +// manual(mySpeccer); +``` + +#### Defined in + +[config/browser.ts:141](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L141) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/config/browser/README.md b/api/config/browser/README.md deleted file mode 100644 index 0b8125d1..00000000 --- a/api/config/browser/README.md +++ /dev/null @@ -1,56 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / config/browser - -# config/browser - -Contains the helper functions to activate SPECCER via a script tag, based on attributes: - -> [!NOTE] -> If the activation method is dom or instant, a resize feature is activated, making sure everything is re-rendered on resize. for manual or lazy loading, you are responsible to handle resize yourself. - -## Default implementation -```html - -``` - -Makes `window.speccer()` available to be used when you feel like it - -## Initiate immediately -```html - -``` - -fires off `speccer()` right away - -## Initiate when dom ready -```html - -``` - -Waits for `DOMContentLoaded` - -## Initiate with lazy loading -```html - -``` - -Lazy loads `speccer()` per specced element - -## Index - -### Functions - -- [activate](functions/activate.md) -- [dom](functions/dom.md) -- [lazy](functions/lazy.md) -- [manual](functions/manual.md) diff --git a/api/config/browser/functions/activate.md b/api/config/browser/functions/activate.md deleted file mode 100644 index 975c8dd4..00000000 --- a/api/config/browser/functions/activate.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [config/browser](../README.md) / activate - -# Function: activate() - -> **activate**(`speccer`): `void` - -A function to activate speccer based on script attributes. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `speccer` | [`SpeccerFunctionType`](../../../types/speccer/type-aliases/SpeccerFunctionType.md) | The speccer function to execute. | - -## Returns - -`void` - -## Example - -```ts -// Usage example: -// activate(mySpeccer); -``` - -## Defined in - -[config/browser.ts:149](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L149) diff --git a/api/config/browser/functions/dom.md b/api/config/browser/functions/dom.md deleted file mode 100644 index d4c2dbda..00000000 --- a/api/config/browser/functions/dom.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [config/browser](../README.md) / dom - -# Function: dom() - -> **dom**(`speccer`): `void` - -A function to initialize speccer when the DOM is ready. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `speccer` | [`SpeccerFunctionType`](../../../types/speccer/type-aliases/SpeccerFunctionType.md) | The speccer function to execute. | - -## Returns - -`void` - -## Example - -```ts -// Usage example: -// dom(mySpeccer); -``` - -## Defined in - -[config/browser.ts:62](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L62) diff --git a/api/config/browser/functions/lazy.md b/api/config/browser/functions/lazy.md deleted file mode 100644 index 554342ff..00000000 --- a/api/config/browser/functions/lazy.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [config/browser](../README.md) / lazy - -# Function: lazy() - -> **lazy**(): `void` - -A function to initialize lazy speccer functionality. - -## Returns - -`void` - -## Example - -```ts -// Usage example: -// lazy(); -``` - -## Defined in - -[config/browser.ts:80](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L80) diff --git a/api/config/browser/functions/manual.md b/api/config/browser/functions/manual.md deleted file mode 100644 index 436e1aa4..00000000 --- a/api/config/browser/functions/manual.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [config/browser](../README.md) / manual - -# Function: manual() - -> **manual**(`speccer`): `void` - -A function to manually activate speccer. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `speccer` | [`SpeccerFunctionType`](../../../types/speccer/type-aliases/SpeccerFunctionType.md) | The speccer function to execute. | - -## Returns - -`void` - -## Example - -```ts -// Usage example: -// manual(mySpeccer); -``` - -## Defined in - -[config/browser.ts:134](https://github.com/phun-ky/speccer/blob/main/src/config/browser.ts#L134) diff --git a/api/features/a11y.md b/api/features/a11y.md new file mode 100644 index 00000000..07296c9d --- /dev/null +++ b/api/features/a11y.md @@ -0,0 +1,179 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/a11y + +# features/a11y + +> Last updated 2024-08-14T10:18:52.240Z + +## Functions + +### create() + +```ts +function create( + type?, + content?, + n?): HTMLElement +``` + +Creates an HTML element based on the specified type. +* + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). | +| `content`? | `unknown` | `undefined` | Content to be added to the element. | +| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). | + +#### Returns + +`HTMLElement` + +The created HTML element. + +#### Example + +```ts +const tabElement = create('tabstops', null, 'div'); +const landmarkElement = create('landmark', 1, 'div'); +const regionElement = create('region', null, 'div'); +``` + +#### Defined in + +[features/a11y/index.ts:29](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L29) + +*** + +### element() + +```ts +function element( + targetEl, + content?, +type?): Promise +``` + +Adds an accessibility element to the document body based on the target element and type. + +![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-tabstop.png?raw=true) +![Screenshot of speccer a11y landmark in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-landmark.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | Target HTML element. | +| `content`? | `unknown` | Content to be added to the accessibility element. | +| `type`? | `string` | Type of accessibility element ('tabstops' or 'landmark'). | + +#### Returns + +`Promise`\<`void`\> + +A Promise resolving when the operation is complete. + +#### Example + +```ts +const targetElement = document.getElementById('myElement'); +if (targetElement) { + await element(targetElement, 1, 'landmark'); + await element(targetElement, null, 'tabstops'); +} +``` + +#### Defined in + +[features/a11y/index.ts:72](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L72) + +*** + +### init() + +```ts +function init(): void +``` + +Initializes the accessibility elements on the document. + +#### Returns + +`void` + +#### Example + +```ts +init(); +``` + +#### Defined in + +[features/a11y/index.ts:167](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L167) + +*** + +### shortcut() + +```ts +function shortcut(el, shortcutString): Promise +``` + +Adds a shortcut element to the document body based on the provided HTML element and shortcut string. + +![Screenshot of speccer a11y shortcuts in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-shortcut.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | Target HTML element. | +| `shortcutString` | `string` | Shortcut string to be displayed. | + +#### Returns + +`Promise`\<`void`\> + +A Promise resolving when the operation is complete. + +#### Example + +```ts +const shortcutElement = document.getElementById('shortcutElement'); +if (shortcutElement) { + await shortcut(shortcutElement, 'Ctrl + Shift + A'); +} +``` + +#### Defined in + +[features/a11y/index.ts:115](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L115) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/a11y/README.md b/api/features/a11y/README.md deleted file mode 100644 index 2313f13d..00000000 --- a/api/features/a11y/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/a11y - -# features/a11y - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) -- [init](functions/init.md) -- [shortcut](functions/shortcut.md) diff --git a/api/features/a11y/constants.md b/api/features/a11y/constants.md new file mode 100644 index 00000000..f2f14768 --- /dev/null +++ b/api/features/a11y/constants.md @@ -0,0 +1,87 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / features/a11y/constants + +# features/a11y/constants + +> Last updated 2024-08-14T10:18:52.241Z + +## Variables + +### SPECCER\_LANDMARK\_ELEMENTS\_SELECTOR + +```ts +const SPECCER_LANDMARK_ELEMENTS_SELECTOR: "\nheader, footer, section, main, nav, aside, [role=\"section\"], [role=\"banner\"],\n[role=\"complementary\"], [role=\"contentinfo\"], [role=\"form\"], [role=\"main\"],\n[role=\"navigation\"], [role=\"region\"], [role=\"search\"]\n"; +``` + +Selector string for landmark elements. + +#### Defined in + +[features/a11y/constants/index.ts:50](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L50) + +*** + +### SPECCER\_MODIFIER\_KEYS + +```ts +const SPECCER_MODIFIER_KEYS: string[]; +``` + +Array of keys considered as modifiers in shortcuts. + +#### Defined in + +[features/a11y/constants/index.ts:5](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L5) + +*** + +### SPECCER\_PHYSICAL\_KEYS + +```ts +const SPECCER_PHYSICAL_KEYS: string[]; +``` + +#### Defined in + +[features/a11y/constants/index.ts:26](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L26) + +*** + +### SPECCER\_TABBABLE\_ELEMENTS\_SELECTOR + +```ts +const SPECCER_TABBABLE_ELEMENTS_SELECTOR: "\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\n textarea:not([disabled]):not([tabindex='-1']),\n iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]\n"; +``` + +Selector string for tabbable elements. + +#### Defined in + +[features/a11y/constants/index.ts:39](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L39) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/a11y/constants/README.md b/api/features/a11y/constants/README.md deleted file mode 100644 index 32217115..00000000 --- a/api/features/a11y/constants/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / features/a11y/constants - -# features/a11y/constants - -## Index - -### Variables - -- [SPECCER\_LANDMARK\_ELEMENTS\_SELECTOR](variables/SPECCER_LANDMARK_ELEMENTS_SELECTOR.md) -- [SPECCER\_MODIFIER\_KEYS](variables/SPECCER_MODIFIER_KEYS.md) -- [SPECCER\_PHYSICAL\_KEYS](variables/SPECCER_PHYSICAL_KEYS.md) -- [SPECCER\_TABBABLE\_ELEMENTS\_SELECTOR](variables/SPECCER_TABBABLE_ELEMENTS_SELECTOR.md) diff --git a/api/features/a11y/constants/variables/SPECCER_LANDMARK_ELEMENTS_SELECTOR.md b/api/features/a11y/constants/variables/SPECCER_LANDMARK_ELEMENTS_SELECTOR.md deleted file mode 100644 index f886e1ca..00000000 --- a/api/features/a11y/constants/variables/SPECCER_LANDMARK_ELEMENTS_SELECTOR.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [features/a11y/constants](../README.md) / SPECCER\_LANDMARK\_ELEMENTS\_SELECTOR - -# Variable: SPECCER\_LANDMARK\_ELEMENTS\_SELECTOR - -> `const` **SPECCER\_LANDMARK\_ELEMENTS\_SELECTOR**: "\nheader, footer, section, main, nav, aside, \[role=\"section\"\], \[role=\"banner\"\],\n\[role=\"complementary\"\], \[role=\"contentinfo\"\], \[role=\"form\"\], \[role=\"main\"\],\n\[role=\"navigation\"\], \[role=\"region\"\], \[role=\"search\"\]\n" - -Selector string for landmark elements. - -## Defined in - -[features/a11y/constants/index.ts:50](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L50) diff --git a/api/features/a11y/constants/variables/SPECCER_MODIFIER_KEYS.md b/api/features/a11y/constants/variables/SPECCER_MODIFIER_KEYS.md deleted file mode 100644 index f46ebd71..00000000 --- a/api/features/a11y/constants/variables/SPECCER_MODIFIER_KEYS.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [features/a11y/constants](../README.md) / SPECCER\_MODIFIER\_KEYS - -# Variable: SPECCER\_MODIFIER\_KEYS - -> `const` **SPECCER\_MODIFIER\_KEYS**: `string`[] - -Array of keys considered as modifiers in shortcuts. - -## Defined in - -[features/a11y/constants/index.ts:5](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L5) diff --git a/api/features/a11y/constants/variables/SPECCER_PHYSICAL_KEYS.md b/api/features/a11y/constants/variables/SPECCER_PHYSICAL_KEYS.md deleted file mode 100644 index c5656a10..00000000 --- a/api/features/a11y/constants/variables/SPECCER_PHYSICAL_KEYS.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [features/a11y/constants](../README.md) / SPECCER\_PHYSICAL\_KEYS - -# Variable: SPECCER\_PHYSICAL\_KEYS - -> `const` **SPECCER\_PHYSICAL\_KEYS**: `string`[] - -## Defined in - -[features/a11y/constants/index.ts:26](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L26) diff --git a/api/features/a11y/constants/variables/SPECCER_TABBABLE_ELEMENTS_SELECTOR.md b/api/features/a11y/constants/variables/SPECCER_TABBABLE_ELEMENTS_SELECTOR.md deleted file mode 100644 index edf705c7..00000000 --- a/api/features/a11y/constants/variables/SPECCER_TABBABLE_ELEMENTS_SELECTOR.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [features/a11y/constants](../README.md) / SPECCER\_TABBABLE\_ELEMENTS\_SELECTOR - -# Variable: SPECCER\_TABBABLE\_ELEMENTS\_SELECTOR - -> `const` **SPECCER\_TABBABLE\_ELEMENTS\_SELECTOR**: "\n a\[href\], area\[href\], input:not(\[disabled\]):not(\[tabindex='-1'\]),\n button:not(\[disabled\]):not(\[tabindex='-1'\]),select:not(\[disabled\]):not(\[tabindex='-1'\]),\n textarea:not(\[disabled\]):not(\[tabindex='-1'\]),\n iframe, object, embed, \*\[tabindex\]:not(\[tabindex='-1'\]), \*\[contenteditable=true\]\n" - -Selector string for tabbable elements. - -## Defined in - -[features/a11y/constants/index.ts:39](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/constants/index.ts#L39) diff --git a/api/features/a11y/functions/create.md b/api/features/a11y/functions/create.md deleted file mode 100644 index c0cc5944..00000000 --- a/api/features/a11y/functions/create.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/a11y](../README.md) / create - -# Function: create() - -> **create**(`type`?, `content`?, `n`?): `HTMLElement` - -Creates an HTML element based on the specified type. -* - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `type`? | `string` | `'tabstops'` | Type of element ('tabstops', 'landmark', 'region'). | -| `content`? | `unknown` | `undefined` | Content to be added to the element. | -| `n`? | `string` | `'span'` | HTML tag name (default is 'span'). | - -## Returns - -`HTMLElement` - -The created HTML element. - -## Example - -```ts -const tabElement = create('tabstops', null, 'div'); -const landmarkElement = create('landmark', 1, 'div'); -const regionElement = create('region', null, 'div'); -``` - -## Defined in - -[features/a11y/index.ts:29](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L29) diff --git a/api/features/a11y/functions/element.md b/api/features/a11y/functions/element.md deleted file mode 100644 index 173f46de..00000000 --- a/api/features/a11y/functions/element.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/a11y](../README.md) / element - -# Function: element() - -> **element**(`targetEl`, `content`?, `type`?): `Promise`\<`void`\> - -Adds an accessibility element to the document body based on the target element and type. - -![Screenshot of speccer a11y tab stops in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-tabstop.png?raw=true) -![Screenshot of speccer a11y landmark in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-landmark.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | Target HTML element. | -| `content`? | `unknown` | Content to be added to the accessibility element. | -| `type`? | `string` | Type of accessibility element ('tabstops' or 'landmark'). | - -## Returns - -`Promise`\<`void`\> - -A Promise resolving when the operation is complete. - -## Example - -```ts -const targetElement = document.getElementById('myElement'); -if (targetElement) { - await element(targetElement, 1, 'landmark'); - await element(targetElement, null, 'tabstops'); -} -``` - -## Defined in - -[features/a11y/index.ts:72](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L72) diff --git a/api/features/a11y/functions/init.md b/api/features/a11y/functions/init.md deleted file mode 100644 index 20e8ec60..00000000 --- a/api/features/a11y/functions/init.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/a11y](../README.md) / init - -# Function: init() - -> **init**(): `void` - -Initializes the accessibility elements on the document. - -## Returns - -`void` - -## Example - -```ts -init(); -``` - -## Defined in - -[features/a11y/index.ts:167](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L167) diff --git a/api/features/a11y/functions/shortcut.md b/api/features/a11y/functions/shortcut.md deleted file mode 100644 index 34b4c6f1..00000000 --- a/api/features/a11y/functions/shortcut.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/a11y](../README.md) / shortcut - -# Function: shortcut() - -> **shortcut**(`el`, `shortcutString`): `Promise`\<`void`\> - -Adds a shortcut element to the document body based on the provided HTML element and shortcut string. - -![Screenshot of speccer a11y shortcuts in use](https://github.com/phun-ky/speccer/blob/main/public/a11y-shortcut.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | Target HTML element. | -| `shortcutString` | `string` | Shortcut string to be displayed. | - -## Returns - -`Promise`\<`void`\> - -A Promise resolving when the operation is complete. - -## Example - -```ts -const shortcutElement = document.getElementById('shortcutElement'); -if (shortcutElement) { - await shortcut(shortcutElement, 'Ctrl + Shift + A'); -} -``` - -## Defined in - -[features/a11y/index.ts:115](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L115) diff --git a/api/features/a11y/utils/styles.md b/api/features/a11y/utils/styles.md new file mode 100644 index 00000000..1f5d5815 --- /dev/null +++ b/api/features/a11y/utils/styles.md @@ -0,0 +1,86 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/a11y/utils/styles + +# features/a11y/utils/styles + +> Last updated 2024-08-14T10:18:52.242Z + +## Functions + +### styles() + +```ts +function styles( + type, + targetEl, +a11yEl): Promise +``` + +Calculates and returns the styles for an accessibility element based on its type. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `type` | `string` | Type of the accessibility element ('tabstops', 'landmark', 'region', 'shortcut', or default). | +| `targetEl` | `HTMLElement` | Target HTML element. | +| `a11yEl` | `HTMLElement` | Accessibility HTML element to be styled. | + +#### Returns + +`Promise`\<[`SpeccerStylesReturnType`](../../../types/styles.md#speccerstylesreturntype)\> + +A Promise resolving with the calculated styles. + +#### Example + +```ts +const targetElement = document.getElementById('targetElement'); +const a11yElement = document.createElement('div'); + +// Example for tab order element styles +const tabstopsStyles = await styles('tabstops', targetElement, a11yElement); + +// Example for landmark element styles +const landmarkStyles = await styles('landmark', targetElement, a11yElement); + +// Example for region element styles +const regionStyles = await styles('region', targetElement, a11yElement); + +// Example for shortcut element styles +const shortcutStyles = await styles('shortcut', targetElement, a11yElement); + +// Example for default styles +const defaultStyles = await styles('default', targetElement, a11yElement); +``` + +#### Defined in + +[features/a11y/utils/styles.ts:35](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/utils/styles.ts#L35) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/a11y/utils/styles/README.md b/api/features/a11y/utils/styles/README.md deleted file mode 100644 index f9bb3586..00000000 --- a/api/features/a11y/utils/styles/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/a11y/utils/styles - -# features/a11y/utils/styles - -## Index - -### Functions - -- [styles](functions/styles.md) diff --git a/api/features/a11y/utils/styles/functions/styles.md b/api/features/a11y/utils/styles/functions/styles.md deleted file mode 100644 index fe6d600e..00000000 --- a/api/features/a11y/utils/styles/functions/styles.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/a11y/utils/styles](../README.md) / styles - -# Function: styles() - -> **styles**(`type`, `targetEl`, `a11yEl`): `Promise`\<[`SpeccerStylesReturnType`](../../../../../types/styles/type-aliases/SpeccerStylesReturnType.md)\> - -Calculates and returns the styles for an accessibility element based on its type. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `type` | `string` | Type of the accessibility element ('tabstops', 'landmark', 'region', 'shortcut', or default). | -| `targetEl` | `HTMLElement` | Target HTML element. | -| `a11yEl` | `HTMLElement` | Accessibility HTML element to be styled. | - -## Returns - -`Promise`\<[`SpeccerStylesReturnType`](../../../../../types/styles/type-aliases/SpeccerStylesReturnType.md)\> - -A Promise resolving with the calculated styles. - -## Example - -```ts -const targetElement = document.getElementById('targetElement'); -const a11yElement = document.createElement('div'); - -// Example for tab order element styles -const tabstopsStyles = await styles('tabstops', targetElement, a11yElement); - -// Example for landmark element styles -const landmarkStyles = await styles('landmark', targetElement, a11yElement); - -// Example for region element styles -const regionStyles = await styles('region', targetElement, a11yElement); - -// Example for shortcut element styles -const shortcutStyles = await styles('shortcut', targetElement, a11yElement); - -// Example for default styles -const defaultStyles = await styles('default', targetElement, a11yElement); -``` - -## Defined in - -[features/a11y/utils/styles.ts:35](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/utils/styles.ts#L35) diff --git a/api/features/dissect.md b/api/features/dissect.md new file mode 100644 index 00000000..c1d961bf --- /dev/null +++ b/api/features/dissect.md @@ -0,0 +1,93 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/dissect + +# features/dissect + +> Last updated 2024-08-14T10:18:52.242Z + +This feature highlights the anatomy of an element. + +![dissect](https://github.com/phun-ky/speccer/blob/main/public/anatomy.png?raw=true) + +In your component examples, use the following attribute. Remember to use the `data-anatomy-section` as an attribute on a parent element to scope the marking. + +## Example + +```html +
+
+
+``` + +## References + +### create + +Re-exports [create](dissect/utils/create.md#create) + +### dissect + +Re-exports [dissect](dissect/utils/dissect.md#dissect) + +## Functions + +### element() + +```ts +function element(sectionEl): Promise +``` + +Create dissected elements based on the section element and its data-anatomy attributes. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `sectionEl` | `HTMLElement` | The section element containing dissected elements. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves after creating dissected elements. + +#### Example + +```ts +const sectionElement = document.getElementById('section'); +element(sectionElement); +``` + +#### Defined in + +[features/dissect/index.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L41) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/dissect/README.md b/api/features/dissect/README.md deleted file mode 100644 index 92dabd0d..00000000 --- a/api/features/dissect/README.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/dissect - -# features/dissect - -This feature highlights the anatomy of an element. - -![dissect](https://github.com/phun-ky/speccer/blob/main/public/anatomy.png?raw=true) - -In your component examples, use the following attribute. Remember to use the `data-anatomy-section` as an attribute on a parent element to scope the marking. - -## Example - -```html -
-
-
-``` - -## Index - -### Functions - -- [element](functions/element.md) - -## References - -### create - -Re-exports [create](utils/create/functions/create.md) - -*** - -### dissect - -Re-exports [dissect](utils/dissect/functions/dissect.md) diff --git a/api/features/dissect/functions/element.md b/api/features/dissect/functions/element.md deleted file mode 100644 index b16629f9..00000000 --- a/api/features/dissect/functions/element.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/dissect](../README.md) / element - -# Function: element() - -> **element**(`sectionEl`): `Promise`\<`void`\> - -Create dissected elements based on the section element and its data-anatomy attributes. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `sectionEl` | `HTMLElement` | The section element containing dissected elements. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves after creating dissected elements. - -## Example - -```ts -const sectionElement = document.getElementById('section'); -element(sectionElement); -``` - -## Defined in - -[features/dissect/index.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/index.ts#L41) diff --git a/api/features/dissect/utils/create.md b/api/features/dissect/utils/create.md new file mode 100644 index 00000000..5a9fa7e8 --- /dev/null +++ b/api/features/dissect/utils/create.md @@ -0,0 +1,73 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/dissect/utils/create + +# features/dissect/utils/create + +> Last updated 2024-08-14T10:18:52.243Z + +## Functions + +### create() + +```ts +function create( + textContent, + area, + id, + n): HTMLElement +``` + +Create a dissected element with optional text content, area description, and element type. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `textContent` | `string` | `''` | The text content to add to the element. | +| `area` | `string` | `undefined` | The area description for styling. | +| `id` | `string` | `''` | The id of the dissection element | +| `n` | `string` | `'span'` | The element type. | + +#### Returns + +`HTMLElement` + +- The created dissected element. + +#### Example + +```ts +const dissectedElement = create('A', 'outline top', 'div'); +document.body.appendChild(dissectedElement); +``` + +#### Defined in + +[features/dissect/utils/create.ts:19](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/create.ts#L19) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/dissect/utils/create/README.md b/api/features/dissect/utils/create/README.md deleted file mode 100644 index d88847ee..00000000 --- a/api/features/dissect/utils/create/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/dissect/utils/create - -# features/dissect/utils/create - -## Index - -### Functions - -- [create](functions/create.md) diff --git a/api/features/dissect/utils/create/functions/create.md b/api/features/dissect/utils/create/functions/create.md deleted file mode 100644 index 8bf06916..00000000 --- a/api/features/dissect/utils/create/functions/create.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/dissect/utils/create](../README.md) / create - -# Function: create() - -> **create**(`textContent`, `area`, `id`, `n`): `HTMLElement` - -Create a dissected element with optional text content, area description, and element type. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `textContent` | `string` | `''` | The text content to add to the element. | -| `area` | `string` | `undefined` | The area description for styling. | -| `id` | `string` | `''` | The id of the dissection element | -| `n` | `string` | `'span'` | The element type. | - -## Returns - -`HTMLElement` - -- The created dissected element. - -## Example - -```ts -const dissectedElement = create('A', 'outline top', 'div'); -document.body.appendChild(dissectedElement); -``` - -## Defined in - -[features/dissect/utils/create.ts:19](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/create.ts#L19) diff --git a/api/features/dissect/utils/dissect.md b/api/features/dissect/utils/dissect.md new file mode 100644 index 00000000..a402d153 --- /dev/null +++ b/api/features/dissect/utils/dissect.md @@ -0,0 +1,77 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/dissect/utils/dissect + +# features/dissect/utils/dissect + +> Last updated 2024-08-14T10:18:52.243Z + +## Functions + +### dissect() + +```ts +function dissect( + el, + symbol, +areas?): Promise +``` + +Create and style the dissection element as needed. + +This function appends a new dissection element to the document body based on the anatomy data attribute +of the target element. It handles different styles, such as curly brackets or lines, based on the anatomy type. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el` | `HTMLElement` | `undefined` | The target element that contains the anatomy data. | +| `symbol` | `string` | `undefined` | The symbol to use. | +| `areas`? | `string` | `''` | Optional areas to use if not [data-anatomy] is set as an attribute on the element | + +#### Returns + +`Promise`\<`string` \| `void`\> + +A promise that resolves to the id of the dissection element when the dissection is completed, or `void` if required input is invalid. + +#### Example + +```ts +const element = document.getElementById('target'); +const symbol = 0; +dissect(element, symbol).then(() => { + console.log('Dissection completed'); +}); +``` + +#### Defined in + +[features/dissect/utils/dissect.ts:34](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/dissect.ts#L34) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/dissect/utils/dissect/README.md b/api/features/dissect/utils/dissect/README.md deleted file mode 100644 index fd6dcef1..00000000 --- a/api/features/dissect/utils/dissect/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/dissect/utils/dissect - -# features/dissect/utils/dissect - -## Index - -### Functions - -- [dissect](functions/dissect.md) diff --git a/api/features/dissect/utils/dissect/functions/dissect.md b/api/features/dissect/utils/dissect/functions/dissect.md deleted file mode 100644 index cf8861b8..00000000 --- a/api/features/dissect/utils/dissect/functions/dissect.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/dissect/utils/dissect](../README.md) / dissect - -# Function: dissect() - -> **dissect**(`el`, `symbol`, `areas`?): `Promise`\<`string` \| `void`\> - -Create and style the dissection element as needed. - -This function appends a new dissection element to the document body based on the anatomy data attribute -of the target element. It handles different styles, such as curly brackets or lines, based on the anatomy type. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el` | `HTMLElement` | `undefined` | The target element that contains the anatomy data. | -| `symbol` | `string` | `undefined` | The symbol to use. | -| `areas`? | `string` | `''` | Optional areas to use if not [data-anatomy] is set as an attribute on the element | - -## Returns - -`Promise`\<`string` \| `void`\> - -A promise that resolves to the id of the dissection element when the dissection is completed, or `void` if required input is invalid. - -## Example - -```ts -const element = document.getElementById('target'); -const symbol = 0; -dissect(element, symbol).then(() => { - console.log('Dissection completed'); -}); -``` - -## Defined in - -[features/dissect/utils/dissect.ts:34](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/dissect.ts#L34) diff --git a/api/features/dissect/utils/get-character-to-use.md b/api/features/dissect/utils/get-character-to-use.md new file mode 100644 index 00000000..68dc0e0c --- /dev/null +++ b/api/features/dissect/utils/get-character-to-use.md @@ -0,0 +1,67 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/dissect/utils/get-character-to-use + +# features/dissect/utils/get-character-to-use + +> Last updated 2024-08-14T10:18:52.244Z + +## Functions + +### getCharacterToUse() + +```ts +function getCharacterToUse(targetIndex): string +``` + +Returns the character to use at the specified target index. +If the index exceeds the available characters, it generates a new character by pairing uppercase and lowercase letters. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetIndex` | `number` | The index of the character to retrieve. | + +#### Returns + +`string` + +The character to use at the specified index. + +#### Example + +```ts +const character = getCharacterToUse(0); // Returns first character from SPECCER_LITERALS +const nextCharacter = getCharacterToUse(25); // Returns next character or a generated pair if index exceeds literals length +``` + +#### Defined in + +[features/dissect/utils/get-character-to-use.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/get-character-to-use.ts#L18) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/dissect/utils/get-character-to-use/README.md b/api/features/dissect/utils/get-character-to-use/README.md deleted file mode 100644 index 57eabb3c..00000000 --- a/api/features/dissect/utils/get-character-to-use/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/dissect/utils/get-character-to-use - -# features/dissect/utils/get-character-to-use - -## Index - -### Functions - -- [getCharacterToUse](functions/getCharacterToUse.md) diff --git a/api/features/dissect/utils/get-character-to-use/functions/getCharacterToUse.md b/api/features/dissect/utils/get-character-to-use/functions/getCharacterToUse.md deleted file mode 100644 index 185a5287..00000000 --- a/api/features/dissect/utils/get-character-to-use/functions/getCharacterToUse.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/dissect/utils/get-character-to-use](../README.md) / getCharacterToUse - -# Function: getCharacterToUse() - -> **getCharacterToUse**(`targetIndex`): `string` - -Returns the character to use at the specified target index. -If the index exceeds the available characters, it generates a new character by pairing uppercase and lowercase letters. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetIndex` | `number` | The index of the character to retrieve. | - -## Returns - -`string` - -The character to use at the specified index. - -## Example - -```ts -const character = getCharacterToUse(0); // Returns first character from SPECCER_LITERALS -const nextCharacter = getCharacterToUse(25); // Returns next character or a generated pair if index exceeds literals length -``` - -## Defined in - -[features/dissect/utils/get-character-to-use.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/get-character-to-use.ts#L18) diff --git a/api/features/dissect/utils/styles.md b/api/features/dissect/utils/styles.md new file mode 100644 index 00000000..76af8761 --- /dev/null +++ b/api/features/dissect/utils/styles.md @@ -0,0 +1,77 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/dissect/utils/styles + +# features/dissect/utils/styles + +> Last updated 2024-08-14T10:18:52.244Z + +## Functions + +### styles() + +```ts +function styles( + area, + targetEl, + dissectionEl, +options?): Promise +``` + +Get styles for dissected elements based on the specified area and options. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `area` | `string` | The area description. | +| `targetEl` | `HTMLElement` | The target element. | +| `dissectionEl` | `HTMLElement` | The dissection element. | +| `options`? | [`DissectStylesOptionsType`](../../../types/bezier.md#dissectstylesoptionstype) | Optional styles options. | + +#### Returns + +`Promise`\<[`SpeccerStylesReturnType`](../../../types/styles.md#speccerstylesreturntype)\> + +- The computed styles. + +#### Example + +```ts +const area = 'top-left'; +const targetElement = document.getElementById('target'); +const dissectionElement = document.getElementById('dissection'); +const options = { isCurly: true }; +const styles = await styles(area, targetElement, dissectionElement, options); +console.log(styles); +``` + +#### Defined in + +[features/dissect/utils/styles.ts:33](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/styles.ts#L33) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/dissect/utils/styles/README.md b/api/features/dissect/utils/styles/README.md deleted file mode 100644 index b324ce51..00000000 --- a/api/features/dissect/utils/styles/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/dissect/utils/styles - -# features/dissect/utils/styles - -## Index - -### Functions - -- [styles](functions/styles.md) diff --git a/api/features/dissect/utils/styles/functions/styles.md b/api/features/dissect/utils/styles/functions/styles.md deleted file mode 100644 index 71ee4476..00000000 --- a/api/features/dissect/utils/styles/functions/styles.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/dissect/utils/styles](../README.md) / styles - -# Function: styles() - -> **styles**(`area`, `targetEl`, `dissectionEl`, `options`?): `Promise`\<[`SpeccerStylesReturnType`](../../../../../types/styles/type-aliases/SpeccerStylesReturnType.md)\> - -Get styles for dissected elements based on the specified area and options. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `area` | `string` | The area description. | -| `targetEl` | `HTMLElement` | The target element. | -| `dissectionEl` | `HTMLElement` | The dissection element. | -| `options`? | [`DissectStylesOptionsType`](../../../../../types/bezier/type-aliases/DissectStylesOptionsType.md) | Optional styles options. | - -## Returns - -`Promise`\<[`SpeccerStylesReturnType`](../../../../../types/styles/type-aliases/SpeccerStylesReturnType.md)\> - -- The computed styles. - -## Example - -```ts -const area = 'top-left'; -const targetElement = document.getElementById('target'); -const dissectionElement = document.getElementById('dissection'); -const options = { isCurly: true }; -const styles = await styles(area, targetElement, dissectionElement, options); -console.log(styles); -``` - -## Defined in - -[features/dissect/utils/styles.ts:33](https://github.com/phun-ky/speccer/blob/main/src/features/dissect/utils/styles.ts#L33) diff --git a/api/features/grid.md b/api/features/grid.md new file mode 100644 index 00000000..c48f7f94 --- /dev/null +++ b/api/features/grid.md @@ -0,0 +1,112 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/grid + +# features/grid + +> Last updated 2024-08-14T10:18:52.244Z + +## Functions + +### create() + +```ts +function create(targetElement, styles): HTMLDivElement +``` + +Creates a visual grid overlay for a given target element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetElement` | `HTMLElement` | The target element to create the grid overlay for. | +| `styles` | `CSSStyleDeclaration` | The computed styles of the target element. | + +#### Returns + +`HTMLDivElement` + +The created grid container element. + +#### Example + +```ts +const targetElement = document.getElementById('target'); +if (targetElement) { + const styles = window.getComputedStyle(targetElement); + const gridOverlay = create(targetElement, styles); + document.body.appendChild(gridOverlay); +} +``` + +#### Defined in + +[features/grid/index.ts:24](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L24) + +*** + +### element() + +```ts +function element(targetElement): Promise +``` + +Create a visual overlay to present the column gaps for a grid container + +Adds a visual grid overlay to the target element if it has the appropriate data attribute and is a grid. + +![grid](https://github.com/phun-ky/speccer/blob/main/public/grid.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetElement` | `HTMLElement` | The target element to add the grid overlay to. | + +#### Returns + +`Promise`\<`void`\> + +A promise that resolves once the overlay has been added. + +#### Example + +```ts +const targetElement = document.getElementById('target'); +if (targetElement) { + element(targetElement).then(() => { + console.log('Grid overlay added'); + }); +} +``` + +#### Defined in + +[features/grid/index.ts:89](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L89) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/grid/README.md b/api/features/grid/README.md deleted file mode 100644 index c768b800..00000000 --- a/api/features/grid/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/grid - -# features/grid - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) diff --git a/api/features/grid/functions/create.md b/api/features/grid/functions/create.md deleted file mode 100644 index be3edf4f..00000000 --- a/api/features/grid/functions/create.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/grid](../README.md) / create - -# Function: create() - -> **create**(`targetElement`, `styles`): `HTMLDivElement` - -Creates a visual grid overlay for a given target element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetElement` | `HTMLElement` | The target element to create the grid overlay for. | -| `styles` | `CSSStyleDeclaration` | The computed styles of the target element. | - -## Returns - -`HTMLDivElement` - -The created grid container element. - -## Example - -```ts -const targetElement = document.getElementById('target'); -if (targetElement) { - const styles = window.getComputedStyle(targetElement); - const gridOverlay = create(targetElement, styles); - document.body.appendChild(gridOverlay); -} -``` - -## Defined in - -[features/grid/index.ts:24](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L24) diff --git a/api/features/grid/functions/element.md b/api/features/grid/functions/element.md deleted file mode 100644 index 4894cb01..00000000 --- a/api/features/grid/functions/element.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/grid](../README.md) / element - -# Function: element() - -> **element**(`targetElement`): `Promise`\<`void`\> - -Create a visual overlay to present the column gaps for a grid container - -Adds a visual grid overlay to the target element if it has the appropriate data attribute and is a grid. - -![grid](https://github.com/phun-ky/speccer/blob/main/public/grid.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetElement` | `HTMLElement` | The target element to add the grid overlay to. | - -## Returns - -`Promise`\<`void`\> - -A promise that resolves once the overlay has been added. - -## Example - -```ts -const targetElement = document.getElementById('target'); -if (targetElement) { - element(targetElement).then(() => { - console.log('Grid overlay added'); - }); -} -``` - -## Defined in - -[features/grid/index.ts:89](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L89) diff --git a/api/features/mark.md b/api/features/mark.md new file mode 100644 index 00000000..ba7701fc --- /dev/null +++ b/api/features/mark.md @@ -0,0 +1,101 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/mark + +# features/mark + +> Last updated 2024-08-14T10:18:52.245Z + +## Functions + +### create() + +```ts +function create(n): HTMLElement +``` + +Create a marker element with an optional element type. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `n` | `string` | `'span'` | The element type. | + +#### Returns + +`HTMLElement` + +- The created marker element. + +#### Example + +```typescript +const marker = create('div'); +document.body.appendChild(marker); +``` + +#### Defined in + +[features/mark/index.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L18) + +*** + +### element() + +```ts +function element(elementToMark): Promise +``` + +Create a marker element and add it to the body with styles matching a specified element. + +![mark](https://github.com/phun-ky/speccer/blob/main/public/mark.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `elementToMark` | `HTMLElement` | The target element to match styles with. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves after creating and styling the marker element. + +#### Example + +```typescript +const elementToMark = document.getElementById('target'); +element(elementToMark); +``` + +#### Defined in + +[features/mark/index.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L41) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/mark/README.md b/api/features/mark/README.md deleted file mode 100644 index c8d2870f..00000000 --- a/api/features/mark/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/mark - -# features/mark - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) diff --git a/api/features/mark/functions/create.md b/api/features/mark/functions/create.md deleted file mode 100644 index 1b50b6f5..00000000 --- a/api/features/mark/functions/create.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/mark](../README.md) / create - -# Function: create() - -> **create**(`n`): `HTMLElement` - -Create a marker element with an optional element type. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `n` | `string` | `'span'` | The element type. | - -## Returns - -`HTMLElement` - -- The created marker element. - -## Example - -```typescript -const marker = create('div'); -document.body.appendChild(marker); -``` - -## Defined in - -[features/mark/index.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L18) diff --git a/api/features/mark/functions/element.md b/api/features/mark/functions/element.md deleted file mode 100644 index 10aef059..00000000 --- a/api/features/mark/functions/element.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/mark](../README.md) / element - -# Function: element() - -> **element**(`elementToMark`): `Promise`\<`void`\> - -Create a marker element and add it to the body with styles matching a specified element. - -![mark](https://github.com/phun-ky/speccer/blob/main/public/mark.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `elementToMark` | `HTMLElement` | The target element to match styles with. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves after creating and styling the marker element. - -## Example - -```typescript -const elementToMark = document.getElementById('target'); -element(elementToMark); -``` - -## Defined in - -[features/mark/index.ts:41](https://github.com/phun-ky/speccer/blob/main/src/features/mark/index.ts#L41) diff --git a/api/features/measure.md b/api/features/measure.md new file mode 100644 index 00000000..608573bc --- /dev/null +++ b/api/features/measure.md @@ -0,0 +1,106 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/measure + +# features/measure + +> Last updated 2024-08-14T10:18:52.245Z + +## Functions + +### create() + +```ts +function create( + text, + area, + tag): HTMLElement +``` + +Create a measurement element with optional text, area, and element type. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `text` | `string` \| `number` | `''` | The text to display on the element. | +| `area` | `null` \| `string` | `''` | The area to specify with CSS class. | +| `tag` | `string` | `'span'` | The element type. | + +#### Returns + +`HTMLElement` + +- The created measurement element. + +#### Example + +```ts +const measurement = create(100, 'width bottom', 'div'); +document.body.appendChild(measurement); +``` + +#### Defined in + +[features/measure/index.ts:28](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L28) + +*** + +### element() + +```ts +function element(targetEl): Promise +``` + +Create a measurement element and add it to the body with styles matching a specified target element. + +![measure](https://github.com/phun-ky/speccer/blob/main/public/measure.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | The target element to match styles with. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves after creating and styling the measurement element. + +#### Example + +```ts +const targetElement = document.getElementById('target'); +element(targetElement); +``` + +#### Defined in + +[features/measure/index.ts:57](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L57) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/measure/README.md b/api/features/measure/README.md deleted file mode 100644 index a76c488e..00000000 --- a/api/features/measure/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/measure - -# features/measure - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) diff --git a/api/features/measure/functions/create.md b/api/features/measure/functions/create.md deleted file mode 100644 index 616771b8..00000000 --- a/api/features/measure/functions/create.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/measure](../README.md) / create - -# Function: create() - -> **create**(`text`, `area`, `tag`): `HTMLElement` - -Create a measurement element with optional text, area, and element type. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `text` | `string` \| `number` | `''` | The text to display on the element. | -| `area` | `null` \| `string` | `''` | The area to specify with CSS class. | -| `tag` | `string` | `'span'` | The element type. | - -## Returns - -`HTMLElement` - -- The created measurement element. - -## Example - -```ts -const measurement = create(100, 'width bottom', 'div'); -document.body.appendChild(measurement); -``` - -## Defined in - -[features/measure/index.ts:28](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L28) diff --git a/api/features/measure/functions/element.md b/api/features/measure/functions/element.md deleted file mode 100644 index f5feb7b1..00000000 --- a/api/features/measure/functions/element.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/measure](../README.md) / element - -# Function: element() - -> **element**(`targetEl`): `Promise`\<`void`\> - -Create a measurement element and add it to the body with styles matching a specified target element. - -![measure](https://github.com/phun-ky/speccer/blob/main/public/measure.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | The target element to match styles with. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves after creating and styling the measurement element. - -## Example - -```ts -const targetElement = document.getElementById('target'); -element(targetElement); -``` - -## Defined in - -[features/measure/index.ts:57](https://github.com/phun-ky/speccer/blob/main/src/features/measure/index.ts#L57) diff --git a/api/features/spacing.md b/api/features/spacing.md new file mode 100644 index 00000000..ffcbcf88 --- /dev/null +++ b/api/features/spacing.md @@ -0,0 +1,102 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/spacing + +# features/spacing + +> Last updated 2024-08-14T10:18:52.245Z + +## Functions + +### create() + +```ts +function create(text, tag): HTMLElement +``` + +Create a spacing element with optional text content. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `text` | `string` \| `number` | `''` | The optional text content for the spacing element. | +| `tag` | `string` | `'span'` | The HTML tag for the element (default is 'span'). | + +#### Returns + +`HTMLElement` + +- The created spacing element. + +#### Example + +```ts +const spacingElement = create(20, 'div'); +document.body.appendChild(spacingElement); +``` + +#### Defined in + +[features/spacing/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L25) + +*** + +### element() + +```ts +function element(targetEl): Promise +``` + +Create and position spacing elements based on the target element's computed spacing styles. + +![spacing](https://github.com/phun-ky/speccer/blob/main/public/spacing.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | The target element to create spacing elements for. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves after creating and positioning the spacing elements. + +#### Example + +```ts +const targetElement = document.getElementById('target'); +element(targetElement); +``` + +#### Defined in + +[features/spacing/index.ts:53](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L53) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/spacing/README.md b/api/features/spacing/README.md deleted file mode 100644 index fbeb83f6..00000000 --- a/api/features/spacing/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/spacing - -# features/spacing - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) diff --git a/api/features/spacing/functions/create.md b/api/features/spacing/functions/create.md deleted file mode 100644 index f1623c8e..00000000 --- a/api/features/spacing/functions/create.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/spacing](../README.md) / create - -# Function: create() - -> **create**(`text`, `tag`): `HTMLElement` - -Create a spacing element with optional text content. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `text` | `string` \| `number` | `''` | The optional text content for the spacing element. | -| `tag` | `string` | `'span'` | The HTML tag for the element (default is 'span'). | - -## Returns - -`HTMLElement` - -- The created spacing element. - -## Example - -```ts -const spacingElement = create(20, 'div'); -document.body.appendChild(spacingElement); -``` - -## Defined in - -[features/spacing/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L25) diff --git a/api/features/spacing/functions/element.md b/api/features/spacing/functions/element.md deleted file mode 100644 index 674763f4..00000000 --- a/api/features/spacing/functions/element.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/spacing](../README.md) / element - -# Function: element() - -> **element**(`targetEl`): `Promise`\<`void`\> - -Create and position spacing elements based on the target element's computed spacing styles. - -![spacing](https://github.com/phun-ky/speccer/blob/main/public/spacing.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | The target element to create spacing elements for. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves after creating and positioning the spacing elements. - -## Example - -```ts -const targetElement = document.getElementById('target'); -element(targetElement); -``` - -## Defined in - -[features/spacing/index.ts:53](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/index.ts#L53) diff --git a/api/features/spacing/utils/position.md b/api/features/spacing/utils/position.md new file mode 100644 index 00000000..903994c1 --- /dev/null +++ b/api/features/spacing/utils/position.md @@ -0,0 +1,74 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/spacing/utils/position + +# features/spacing/utils/position + +> Last updated 2024-08-14T10:18:52.245Z + +## Functions + +### position() + +```ts +function position( + property, + value, + spacingEl, +targetEl): Promise +``` + +Set the position and dimensions of a spacing element relative to a target element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `property` | `string` | The CSS property to set (e.g., 'marginTop', 'marginLeft', etc.). | +| `value` | `number` | The value of the CSS property. | +| `spacingEl` | `HTMLElement` | The spacing element. | +| `targetEl` | `HTMLElement` | The target element. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves after setting the position and dimensions. + +#### Example + +```ts +const spacingElement = document.getElementById('spacing'); +const targetElement = document.getElementById('target'); +position('marginTop', 20, spacingElement, targetElement); +``` + +#### Defined in + +[features/spacing/utils/position.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/utils/position.ts#L21) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/spacing/utils/position/README.md b/api/features/spacing/utils/position/README.md deleted file mode 100644 index 61aee07e..00000000 --- a/api/features/spacing/utils/position/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/spacing/utils/position - -# features/spacing/utils/position - -## Index - -### Functions - -- [position](functions/position.md) diff --git a/api/features/spacing/utils/position/functions/position.md b/api/features/spacing/utils/position/functions/position.md deleted file mode 100644 index df93158f..00000000 --- a/api/features/spacing/utils/position/functions/position.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/spacing/utils/position](../README.md) / position - -# Function: position() - -> **position**(`property`, `value`, `spacingEl`, `targetEl`): `Promise`\<`void`\> - -Set the position and dimensions of a spacing element relative to a target element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `property` | `string` | The CSS property to set (e.g., 'marginTop', 'marginLeft', etc.). | -| `value` | `number` | The value of the CSS property. | -| `spacingEl` | `HTMLElement` | The spacing element. | -| `targetEl` | `HTMLElement` | The target element. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves after setting the position and dimensions. - -## Example - -```ts -const spacingElement = document.getElementById('spacing'); -const targetElement = document.getElementById('target'); -position('marginTop', 20, spacingElement, targetElement); -``` - -## Defined in - -[features/spacing/utils/position.ts:21](https://github.com/phun-ky/speccer/blob/main/src/features/spacing/utils/position.ts#L21) diff --git a/api/features/typography.md b/api/features/typography.md new file mode 100644 index 00000000..a57f254f --- /dev/null +++ b/api/features/typography.md @@ -0,0 +1,106 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / features/typography + +# features/typography + +> Last updated 2024-08-14T10:18:52.246Z + +## Functions + +### create() + +```ts +function create(html, area): HTMLElement +``` + +Create a DOM element with provided HTML and optional CSS class names. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `html` | `string` | The HTML content to be set in the created element. | +| `area` | `null` \| `string` | The optional CSS class names to add. | + +#### Returns + +`HTMLElement` + +- The created DOM element. + +#### Example + +```ts +const htmlContent = '

This is some HTML content.

'; +const cssClass = 'custom-class'; +const createdElement = create(htmlContent, cssClass); +document.body.appendChild(createdElement); +``` + +#### Defined in + +[features/typography/index.ts:23](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L23) + +*** + +### element() + +```ts +function element(targetEl): Promise +``` + +Create a specced typography element for a given target element. + +![typography](https://github.com/phun-ky/speccer/blob/main/public/typography.png?raw=true) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | The target element to specc typography for. | + +#### Returns + +`Promise`\<`void`\> + +- A promise that resolves once typography element is created and positioned. + +#### Example + +```ts +const targetElement = document.querySelector('.target'); +if (targetElement) { + element(targetElement); +} +``` + +#### Defined in + +[features/typography/index.ts:58](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L58) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/typography/README.md b/api/features/typography/README.md deleted file mode 100644 index 4f774076..00000000 --- a/api/features/typography/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / features/typography - -# features/typography - -## Index - -### Functions - -- [create](functions/create.md) -- [element](functions/element.md) diff --git a/api/features/typography/functions/create.md b/api/features/typography/functions/create.md deleted file mode 100644 index b3d4092f..00000000 --- a/api/features/typography/functions/create.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/typography](../README.md) / create - -# Function: create() - -> **create**(`html`, `area`): `HTMLElement` - -Create a DOM element with provided HTML and optional CSS class names. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `html` | `string` | The HTML content to be set in the created element. | -| `area` | `null` \| `string` | The optional CSS class names to add. | - -## Returns - -`HTMLElement` - -- The created DOM element. - -## Example - -```ts -const htmlContent = '

This is some HTML content.

'; -const cssClass = 'custom-class'; -const createdElement = create(htmlContent, cssClass); -document.body.appendChild(createdElement); -``` - -## Defined in - -[features/typography/index.ts:23](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L23) diff --git a/api/features/typography/functions/element.md b/api/features/typography/functions/element.md deleted file mode 100644 index f31bfe49..00000000 --- a/api/features/typography/functions/element.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [features/typography](../README.md) / element - -# Function: element() - -> **element**(`targetEl`): `Promise`\<`void`\> - -Create a specced typography element for a given target element. - -![typography](https://github.com/phun-ky/speccer/blob/main/public/typography.png?raw=true) - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | The target element to specc typography for. | - -## Returns - -`Promise`\<`void`\> - -- A promise that resolves once typography element is created and positioned. - -## Example - -```ts -const targetElement = document.querySelector('.target'); -if (targetElement) { - element(targetElement); -} -``` - -## Defined in - -[features/typography/index.ts:58](https://github.com/phun-ky/speccer/blob/main/src/features/typography/index.ts#L58) diff --git a/api/features/typography/utils/position.md b/api/features/typography/utils/position.md new file mode 100644 index 00000000..79437346 --- /dev/null +++ b/api/features/typography/utils/position.md @@ -0,0 +1,85 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/typography/utils/position + +# features/typography/utils/position + +> Last updated 2024-08-14T10:18:52.246Z + +## Functions + +### position() + +```ts +function position( + area, + targetEl, + speccerEl): Promise<{ + left: string; + top: string; +}> +``` + +Calculate the position for the speccer element relative to the target element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `area` | `null` \| `string` | The area information for positioning. | +| `targetEl` | `HTMLElement` | The target element. | +| `speccerEl` | `HTMLElement` | The speccer element to position. | + +#### Returns + +`Promise`\<\{ + `left`: `string`; + `top`: `string`; + \}\> + +- A promise that resolves with the calculated position. + +| Name | Type | Defined in | +| ------ | ------ | ------ | +| `left` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | +| `top` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | + +#### Example + +```ts +const targetElement = document.getElementById('target'); +const speccerElement = document.getElementById('speccer'); +const area = 'top'; +const position = await position(area, targetElement, speccerElement); +console.log(position); // { left: '10px', top: '20px' } +``` + +#### Defined in + +[features/typography/utils/position.ts:27](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L27) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/typography/utils/position/README.md b/api/features/typography/utils/position/README.md deleted file mode 100644 index 07ac37b3..00000000 --- a/api/features/typography/utils/position/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/typography/utils/position - -# features/typography/utils/position - -## Index - -### Functions - -- [position](functions/position.md) diff --git a/api/features/typography/utils/position/functions/position.md b/api/features/typography/utils/position/functions/position.md deleted file mode 100644 index d444abf2..00000000 --- a/api/features/typography/utils/position/functions/position.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/typography/utils/position](../README.md) / position - -# Function: position() - -> **position**(`area`, `targetEl`, `speccerEl`): `Promise`\<`object`\> - -Calculate the position for the speccer element relative to the target element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `area` | `null` \| `string` | The area information for positioning. | -| `targetEl` | `HTMLElement` | The target element. | -| `speccerEl` | `HTMLElement` | The speccer element to position. | - -## Returns - -`Promise`\<`object`\> - -- A promise that resolves with the calculated position. - -| Name | Type | Defined in | -| ------ | ------ | ------ | -| `left` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | -| `top` | `string` | [features/typography/utils/position.ts:31](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L31) | - -## Example - -```ts -const targetElement = document.getElementById('target'); -const speccerElement = document.getElementById('speccer'); -const area = 'top'; -const position = await position(area, targetElement, speccerElement); -console.log(position); // { left: '10px', top: '20px' } -``` - -## Defined in - -[features/typography/utils/position.ts:27](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/position.ts#L27) diff --git a/api/features/typography/utils/template.md b/api/features/typography/utils/template.md new file mode 100644 index 00000000..adf01110 --- /dev/null +++ b/api/features/typography/utils/template.md @@ -0,0 +1,68 @@ +SPECCER logo + +[@phun-ky/speccer](../../../README.md) / features/typography/utils/template + +# features/typography/utils/template + +> Last updated 2024-08-14T10:18:52.247Z + +## Functions + +### template() + +```ts +function template(targetEl, useHighlighting?): Promise +``` + +Generate a HTML string for typography styles of a target element. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | `undefined` | The target element for which to generate typography styles. | +| `useHighlighting`? | `boolean` | `false` | If we should use highlighting markup | + +#### Returns + +`Promise`\<`string`\> + +- A promise that resolves with the HTML string. + +#### Example + +```ts +const targetElement = document.getElementById('target'); +const typographyStyles = await template(targetElement, true); +console.log(typographyStyles); +``` + +#### Defined in + +[features/typography/utils/template.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/template.ts#L18) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/features/typography/utils/template/README.md b/api/features/typography/utils/template/README.md deleted file mode 100644 index 78fd1441..00000000 --- a/api/features/typography/utils/template/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / features/typography/utils/template - -# features/typography/utils/template - -## Index - -### Functions - -- [template](functions/template.md) diff --git a/api/features/typography/utils/template/functions/template.md b/api/features/typography/utils/template/functions/template.md deleted file mode 100644 index a6737e75..00000000 --- a/api/features/typography/utils/template/functions/template.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../../README.md) / [features/typography/utils/template](../README.md) / template - -# Function: template() - -> **template**(`targetEl`, `useHighlighting`?): `Promise`\<`string`\> - -Generate a HTML string for typography styles of a target element. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | `undefined` | The target element for which to generate typography styles. | -| `useHighlighting`? | `boolean` | `false` | If we should use highlighting markup | - -## Returns - -`Promise`\<`string`\> - -- A promise that resolves with the HTML string. - -## Example - -```ts -const targetElement = document.getElementById('target'); -const typographyStyles = await template(targetElement, true); -console.log(typographyStyles); -``` - -## Defined in - -[features/typography/utils/template.ts:18](https://github.com/phun-ky/speccer/blob/main/src/features/typography/utils/template.ts#L18) diff --git a/api/main.md b/api/main.md new file mode 100644 index 00000000..e14e638c --- /dev/null +++ b/api/main.md @@ -0,0 +1,602 @@ +SPECCER logo + +[@phun-ky/speccer](README.md) / main + +# main + +> Last updated 2024-08-14T10:18:52.247Z + +## Examples + +```typescript +import '@phun-ky/speccer/dist/speccer.min.css'; +import speccer from '@phun-ky/speccer'; + +// do stuff +speccer(); +``` + +```html + + +``` + +## Variables + +### dissect + +```ts +const dissect: { + create: dissectCreate; + dissect: _dissect; + element: dissectElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`textContent`, `area`, `id`, `n`) => `HTMLElement` + + + +dissectCreate + + + +[main.ts:58](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L58) + +
+ +`dissect` + + + +(`el`, `symbol`, `areas`?) => `Promise`\<`string` \| `void`\> + + + +\_dissect + + + +[main.ts:60](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L60) + +
+ +`element` + + + +(`sectionEl`) => `Promise`\<`void`\> + + + +dissectElement + + + +[main.ts:59](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L59) + +
+ +#### Defined in + +[main.ts:57](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L57) + +*** + +### grid + +```ts +const grid: { + create: gridCreate; + element: gridElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`targetElement`, `styles`) => `HTMLDivElement` + + + +gridCreate + + + +[main.ts:48](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L48) + +
+ +`element` + + + +(`targetElement`) => `Promise`\<`void`\> + + + +gridElement + + + +[main.ts:49](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L49) + +
+ +#### Defined in + +[main.ts:47](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L47) + +*** + +### mark + +```ts +const mark: { + create: markCreate; + element: markElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`n`) => `HTMLElement` + + + +markCreate + + + +[main.ts:69](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L69) + +
+ +`element` + + + +(`elementToMark`) => `Promise`\<`void`\> + + + +markElement + + + +[main.ts:70](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L70) + +
+ +#### Defined in + +[main.ts:68](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L68) + +*** + +### measure + +```ts +const measure: { + create: measureCreate; + element: measureElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`text`, `area`, `tag`) => `HTMLElement` + + + +measureCreate + + + +[main.ts:64](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L64) + +
+ +`element` + + + +(`targetEl`) => `Promise`\<`void`\> + + + +measureElement + + + +[main.ts:65](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L65) + +
+ +#### Defined in + +[main.ts:63](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L63) + +*** + +### modes + +```ts +const modes: { + activate: (speccer) => void; + dom: (speccer) => void; + lazy: () => void; + manual: (speccer) => void; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefined in
+ +`activate` + + + +(`speccer`) => `void` + + + +[main.ts:82](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L82) + +
+ +`dom` + + + +(`speccer`) => `void` + + + +[main.ts:79](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L79) + +
+ +`lazy` + + + +() => `void` + + + +[main.ts:80](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L80) + +
+ +`manual` + + + +(`speccer`) => `void` + + + +[main.ts:81](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L81) + +
+ +#### Defined in + +[main.ts:78](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L78) + +*** + +### spacing + +```ts +const spacing: { + create: spacingCreate; + element: spacingElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`text`, `tag`) => `HTMLElement` + + + +spacingCreate + + + +[main.ts:53](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L53) + +
+ +`element` + + + +(`targetEl`) => `Promise`\<`void`\> + + + +spacingElement + + + +[main.ts:54](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L54) + +
+ +#### Defined in + +[main.ts:52](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L52) + +*** + +### typography + +```ts +const typography: { + create: typographyCreate; + element: typographyElement; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault valueDefined in
+ +`create` + + + +(`html`, `area`) => `HTMLElement` + + + +typographyCreate + + + +[main.ts:74](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L74) + +
+ +`element` + + + +(`targetEl`) => `Promise`\<`void`\> + + + +typographyElement + + + +[main.ts:75](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L75) + +
+ +#### Defined in + +[main.ts:73](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L73) + +## Functions + +### default() + +```ts +function default(): void +``` + +#### Returns + +`void` + +#### Defined in + +[main.ts:85](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L85) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/main/README.md b/api/main/README.md deleted file mode 100644 index 9e68b60a..00000000 --- a/api/main/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@phun-ky/speccer**](../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../README.md) / main - -# main - -![Speccer hero, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-hero.png?raw=true) -SPECCER, a zero dependency package to highlight elements - -## See - - - https://phun-ky.net/projects/speccer/ - - https://github.com/phun-ky/speccer - -## Examples - -```typescript -import '@phun-ky/speccer/dist/speccer.min.css'; -import speccer from '@phun-ky/speccer'; - -// do stuff -speccer(); -``` - -```html - - -``` - -## Index - -### Variables - -- [dissect](variables/dissect.md) -- [grid](variables/grid.md) -- [mark](variables/mark.md) -- [measure](variables/measure.md) -- [modes](variables/modes.md) -- [spacing](variables/spacing.md) -- [typography](variables/typography.md) - -### Functions - -- [default](functions/default.md) diff --git a/api/main/functions/default.md b/api/main/functions/default.md deleted file mode 100644 index da581069..00000000 --- a/api/main/functions/default.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / default - -# Function: default() - -> **default**(): `void` - -## Returns - -`void` - -## Defined in - -[main.ts:89](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L89) diff --git a/api/main/variables/dissect.md b/api/main/variables/dissect.md deleted file mode 100644 index 90be1af1..00000000 --- a/api/main/variables/dissect.md +++ /dev/null @@ -1,90 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / dissect - -# Variable: dissect - -> `const` **dissect**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`textContent`, `area`, `id`, `n`) => `HTMLElement` - - - -dissectCreate - - - -[main.ts:62](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L62) - -
- -`dissect` - - - -(`el`, `symbol`, `areas`?) => `Promise`\<`string` \| `void`\> - - - -\_dissect - - - -[main.ts:64](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L64) - -
- -`element` - - - -(`sectionEl`) => `Promise`\<`void`\> - - - -dissectElement - - - -[main.ts:63](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L63) - -
- -## Defined in - -[main.ts:61](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L61) diff --git a/api/main/variables/grid.md b/api/main/variables/grid.md deleted file mode 100644 index 21360ffc..00000000 --- a/api/main/variables/grid.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / grid - -# Variable: grid - -> `const` **grid**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`targetElement`, `styles`) => `HTMLDivElement` - - - -gridCreate - - - -[main.ts:52](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L52) - -
- -`element` - - - -(`targetElement`) => `Promise`\<`void`\> - - - -gridElement - - - -[main.ts:53](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L53) - -
- -## Defined in - -[main.ts:51](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L51) diff --git a/api/main/variables/mark.md b/api/main/variables/mark.md deleted file mode 100644 index e788c1f1..00000000 --- a/api/main/variables/mark.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / mark - -# Variable: mark - -> `const` **mark**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`n`) => `HTMLElement` - - - -markCreate - - - -[main.ts:73](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L73) - -
- -`element` - - - -(`elementToMark`) => `Promise`\<`void`\> - - - -markElement - - - -[main.ts:74](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L74) - -
- -## Defined in - -[main.ts:72](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L72) diff --git a/api/main/variables/measure.md b/api/main/variables/measure.md deleted file mode 100644 index 64a27642..00000000 --- a/api/main/variables/measure.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / measure - -# Variable: measure - -> `const` **measure**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`text`, `area`, `tag`) => `HTMLElement` - - - -measureCreate - - - -[main.ts:68](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L68) - -
- -`element` - - - -(`targetEl`) => `Promise`\<`void`\> - - - -measureElement - - - -[main.ts:69](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L69) - -
- -## Defined in - -[main.ts:67](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L67) diff --git a/api/main/variables/modes.md b/api/main/variables/modes.md deleted file mode 100644 index c59d998b..00000000 --- a/api/main/variables/modes.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / modes - -# Variable: modes - -> `const` **modes**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefined in
- -`activate` - - - -(`speccer`) => `void` - - - -[main.ts:86](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L86) - -
- -`dom` - - - -(`speccer`) => `void` - - - -[main.ts:83](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L83) - -
- -`lazy` - - - -() => `void` - - - -[main.ts:84](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L84) - -
- -`manual` - - - -(`speccer`) => `void` - - - -[main.ts:85](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L85) - -
- -## Defined in - -[main.ts:82](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L82) diff --git a/api/main/variables/spacing.md b/api/main/variables/spacing.md deleted file mode 100644 index 0f5fa4a8..00000000 --- a/api/main/variables/spacing.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / spacing - -# Variable: spacing - -> `const` **spacing**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`text`, `tag`) => `HTMLElement` - - - -spacingCreate - - - -[main.ts:57](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L57) - -
- -`element` - - - -(`targetEl`) => `Promise`\<`void`\> - - - -spacingElement - - - -[main.ts:58](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L58) - -
- -## Defined in - -[main.ts:56](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L56) diff --git a/api/main/variables/typography.md b/api/main/variables/typography.md deleted file mode 100644 index a282c71f..00000000 --- a/api/main/variables/typography.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / [main](../README.md) / typography - -# Variable: typography - -> `const` **typography**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDefault valueDefined in
- -`create` - - - -(`html`, `area`) => `HTMLElement` - - - -typographyCreate - - - -[main.ts:78](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L78) - -
- -`element` - - - -(`targetEl`) => `Promise`\<`void`\> - - - -typographyElement - - - -[main.ts:79](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L79) - -
- -## Defined in - -[main.ts:77](https://github.com/phun-ky/speccer/blob/main/src/main.ts#L77) diff --git a/api/types/bezier.md b/api/types/bezier.md new file mode 100644 index 00000000..7ea44fec --- /dev/null +++ b/api/types/bezier.md @@ -0,0 +1,452 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/bezier + +# types/bezier + +> Last updated 2024-08-14T10:18:52.248Z + +## Type Aliases + +### BezierPathOptionsType + +```ts +type BezierPathOptionsType: { + pos1: string; + pos2: string; +}; +``` + +Options for creating a bezier path. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`pos1` + + + +`string` + + + +The first position. + + + +[types/bezier.ts:46](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L46) + +
+ +`pos2` + + + +`string` + + + +The second position. + + + +[types/bezier.ts:51](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L51) + +
+ +#### Defined in + +[types/bezier.ts:42](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L42) + +*** + +### CreateCoordinatesForCurveCoordParamType + +```ts +type CreateCoordinatesForCurveCoordParamType: { + x1: number; + x2: number; + y1: number; + y2: number; +}; +``` + +Parameters for creating coordinates for a curve. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`x1` + + + +`number` + + + +The x-coordinate of the first point. + + + +[types/bezier.ts:61](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L61) + +
+ +`x2` + + + +`number` + + + +The x-coordinate of the second point. + + + +[types/bezier.ts:66](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L66) + +
+ +`y1` + + + +`number` + + + +The y-coordinate of the first point. + + + +[types/bezier.ts:71](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L71) + +
+ +`y2` + + + +`number` + + + +The y-coordinate of the second point. + + + +[types/bezier.ts:76](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L76) + +
+ +#### Defined in + +[types/bezier.ts:57](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L57) + +*** + +### CreateCoordinatesForCurveOptionsParamType + +```ts +type CreateCoordinatesForCurveOptionsParamType: { + direct: boolean; + direction: string; + firstSet: boolean; +}; +``` + +Options for creating coordinates for a curve. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`direct` + + + +`boolean` + + + +Indicates whether the curve is direct. + + + +[types/bezier.ts:86](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L86) + +
+ +`direction` + + + +`string` + + + +The direction of the curve. + + + +[types/bezier.ts:96](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L96) + +
+ +`firstSet` + + + +`boolean` + + + +Indicates if this is the first set of coordinates. + + + +[types/bezier.ts:91](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L91) + +
+ +#### Defined in + +[types/bezier.ts:82](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L82) + +*** + +### CurlyBezierPathOptionsType + +```ts +type CurlyBezierPathOptionsType: { + direction: string; + firstSet: boolean; + pos1: string; + pos2: string; +}; +``` + +Options for creating a curly bezier path. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`direction` + + + +`string` + + + +The direction of the path. + + + +[types/bezier.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L36) + +
+ +`firstSet` + + + +`boolean` + + + +Indicates if this is the first part of the curly bracket or not. + + + +[types/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L31) + +
+ +`pos1` + + + +`string` + + + +The first position. + + + +[types/bezier.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L21) + +
+ +`pos2` + + + +`string` + + + +The second position. + + + +[types/bezier.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L26) + +
+ +#### Defined in + +[types/bezier.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L17) + +*** + +### DissectStylesOptionsType + +```ts +type DissectStylesOptionsType: Record | { + isCurly: boolean; +}; +``` + +Options for dissect styles. + +#### Defined in + +[types/bezier.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L5) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/bezier/README.md b/api/types/bezier/README.md deleted file mode 100644 index 7bffab05..00000000 --- a/api/types/bezier/README.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/bezier - -# types/bezier - -## Index - -### Type Aliases - -- [BezierPathOptionsType](type-aliases/BezierPathOptionsType.md) -- [CreateCoordinatesForCurveCoordParamType](type-aliases/CreateCoordinatesForCurveCoordParamType.md) -- [CreateCoordinatesForCurveOptionsParamType](type-aliases/CreateCoordinatesForCurveOptionsParamType.md) -- [CurlyBezierPathOptionsType](type-aliases/CurlyBezierPathOptionsType.md) -- [DissectStylesOptionsType](type-aliases/DissectStylesOptionsType.md) diff --git a/api/types/bezier/type-aliases/BezierPathOptionsType.md b/api/types/bezier/type-aliases/BezierPathOptionsType.md deleted file mode 100644 index ac651f08..00000000 --- a/api/types/bezier/type-aliases/BezierPathOptionsType.md +++ /dev/null @@ -1,70 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/bezier](../README.md) / BezierPathOptionsType - -# Type Alias: BezierPathOptionsType - -> **BezierPathOptionsType**: `object` - -Options for creating a bezier path. - -## Type declaration - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`pos1` - - - -`string` - - - -The first position. - - - -[types/bezier.ts:46](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L46) - -
- -`pos2` - - - -`string` - - - -The second position. - - - -[types/bezier.ts:51](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L51) - -
- -## Defined in - -[types/bezier.ts:42](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L42) diff --git a/api/types/bezier/type-aliases/CreateCoordinatesForCurveCoordParamType.md b/api/types/bezier/type-aliases/CreateCoordinatesForCurveCoordParamType.md deleted file mode 100644 index 129d3422..00000000 --- a/api/types/bezier/type-aliases/CreateCoordinatesForCurveCoordParamType.md +++ /dev/null @@ -1,114 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/bezier](../README.md) / CreateCoordinatesForCurveCoordParamType - -# Type Alias: CreateCoordinatesForCurveCoordParamType - -> **CreateCoordinatesForCurveCoordParamType**: `object` - -Parameters for creating coordinates for a curve. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`x1` - - - -`number` - - - -The x-coordinate of the first point. - - - -[types/bezier.ts:61](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L61) - -
- -`x2` - - - -`number` - - - -The x-coordinate of the second point. - - - -[types/bezier.ts:66](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L66) - -
- -`y1` - - - -`number` - - - -The y-coordinate of the first point. - - - -[types/bezier.ts:71](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L71) - -
- -`y2` - - - -`number` - - - -The y-coordinate of the second point. - - - -[types/bezier.ts:76](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L76) - -
- -## Defined in - -[types/bezier.ts:57](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L57) diff --git a/api/types/bezier/type-aliases/CreateCoordinatesForCurveOptionsParamType.md b/api/types/bezier/type-aliases/CreateCoordinatesForCurveOptionsParamType.md deleted file mode 100644 index 46e5fbdb..00000000 --- a/api/types/bezier/type-aliases/CreateCoordinatesForCurveOptionsParamType.md +++ /dev/null @@ -1,92 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/bezier](../README.md) / CreateCoordinatesForCurveOptionsParamType - -# Type Alias: CreateCoordinatesForCurveOptionsParamType - -> **CreateCoordinatesForCurveOptionsParamType**: `object` - -Options for creating coordinates for a curve. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`direct` - - - -`boolean` - - - -Indicates whether the curve is direct. - - - -[types/bezier.ts:86](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L86) - -
- -`direction` - - - -`string` - - - -The direction of the curve. - - - -[types/bezier.ts:96](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L96) - -
- -`firstSet` - - - -`boolean` - - - -Indicates if this is the first set of coordinates. - - - -[types/bezier.ts:91](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L91) - -
- -## Defined in - -[types/bezier.ts:82](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L82) diff --git a/api/types/bezier/type-aliases/CurlyBezierPathOptionsType.md b/api/types/bezier/type-aliases/CurlyBezierPathOptionsType.md deleted file mode 100644 index 4372b677..00000000 --- a/api/types/bezier/type-aliases/CurlyBezierPathOptionsType.md +++ /dev/null @@ -1,114 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/bezier](../README.md) / CurlyBezierPathOptionsType - -# Type Alias: CurlyBezierPathOptionsType - -> **CurlyBezierPathOptionsType**: `object` - -Options for creating a curly bezier path. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`direction` - - - -`string` - - - -The direction of the path. - - - -[types/bezier.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L36) - -
- -`firstSet` - - - -`boolean` - - - -Indicates if this is the first part of the curly bracket or not. - - - -[types/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L31) - -
- -`pos1` - - - -`string` - - - -The first position. - - - -[types/bezier.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L21) - -
- -`pos2` - - - -`string` - - - -The second position. - - - -[types/bezier.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L26) - -
- -## Defined in - -[types/bezier.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L17) diff --git a/api/types/bezier/type-aliases/DissectStylesOptionsType.md b/api/types/bezier/type-aliases/DissectStylesOptionsType.md deleted file mode 100644 index 9a62130b..00000000 --- a/api/types/bezier/type-aliases/DissectStylesOptionsType.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/bezier](../README.md) / DissectStylesOptionsType - -# Type Alias: DissectStylesOptionsType - -> **DissectStylesOptionsType**: `Record`\<`string`, `never`\> \| `object` - -Options for dissect styles. - -## Defined in - -[types/bezier.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/bezier.ts#L5) diff --git a/api/types/css.md b/api/types/css.md new file mode 100644 index 00000000..ae3c5d62 --- /dev/null +++ b/api/types/css.md @@ -0,0 +1,430 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/css + +# types/css + +> Last updated 2024-08-14T10:18:52.248Z + +## Type Aliases + +### SpacingCSSPropertiesType + +```ts +type SpacingCSSPropertiesType: { + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; +}; +``` + +CSS properties for spacing. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`marginBottom` + + + +`string` + + + +The margin bottom property. + + + +[types/css.ts:13](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L13) + +
+ +`marginLeft` + + + +`string` + + + +The margin left property. + + + +[types/css.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L18) + +
+ +`marginRight` + + + +`string` + + + +The margin right property. + + + +[types/css.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L23) + +
+ +`marginTop` + + + +`string` + + + +The margin top property. + + + +[types/css.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L8) + +
+ +`paddingBottom` + + + +`string` + + + +The padding bottom property. + + + +[types/css.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L33) + +
+ +`paddingLeft` + + + +`string` + + + +The padding left property. + + + +[types/css.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L38) + +
+ +`paddingRight` + + + +`string` + + + +The padding right property. + + + +[types/css.ts:43](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L43) + +
+ +`paddingTop` + + + +`string` + + + +The padding top property. + + + +[types/css.ts:28](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L28) + +
+ +#### Defined in + +[types/css.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L4) + +*** + +### TypographyCSSPropertiesType + +```ts +type TypographyCSSPropertiesType: { + fontFamily: string; + fontSize: string; + fontStyle: string; + fontVariationSettings: string; + fontWeight: string; + letterSpacing: string; + lineHeight: string; +}; +``` + +CSS properties for typography. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefined in
+ +`fontFamily` + + + +`string` + + + +The font family property. + + + +[types/css.ts:63](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L63) + +
+ +`fontSize` + + + +`string` + + + +The font size property. + + + +[types/css.ts:68](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L68) + +
+ +`fontStyle` + + + +`string` + + + +The font style property. + + + +[types/css.ts:73](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L73) + +
+ +`fontVariationSettings` + + + +`string` + + + +The font variation settings property. + + + +[types/css.ts:78](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L78) + +
+ +`fontWeight` + + + +`string` + + + +The font weight property. + + + +[types/css.ts:83](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L83) + +
+ +`letterSpacing` + + + +`string` + + + +The letter spacing property. + + + +[types/css.ts:58](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L58) + +
+ +`lineHeight` + + + +`string` + + + +The line height property. + + + +[types/css.ts:53](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L53) + +
+ +#### Defined in + +[types/css.ts:49](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L49) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/css/README.md b/api/types/css/README.md deleted file mode 100644 index 00dac897..00000000 --- a/api/types/css/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/css - -# types/css - -## Index - -### Type Aliases - -- [SpacingCSSPropertiesType](type-aliases/SpacingCSSPropertiesType.md) -- [TypographyCSSPropertiesType](type-aliases/TypographyCSSPropertiesType.md) diff --git a/api/types/css/type-aliases/SpacingCSSPropertiesType.md b/api/types/css/type-aliases/SpacingCSSPropertiesType.md deleted file mode 100644 index 91952156..00000000 --- a/api/types/css/type-aliases/SpacingCSSPropertiesType.md +++ /dev/null @@ -1,202 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/css](../README.md) / SpacingCSSPropertiesType - -# Type Alias: SpacingCSSPropertiesType - -> **SpacingCSSPropertiesType**: `object` - -CSS properties for spacing. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`marginBottom` - - - -`string` - - - -The margin bottom property. - - - -[types/css.ts:13](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L13) - -
- -`marginLeft` - - - -`string` - - - -The margin left property. - - - -[types/css.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L18) - -
- -`marginRight` - - - -`string` - - - -The margin right property. - - - -[types/css.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L23) - -
- -`marginTop` - - - -`string` - - - -The margin top property. - - - -[types/css.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L8) - -
- -`paddingBottom` - - - -`string` - - - -The padding bottom property. - - - -[types/css.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L33) - -
- -`paddingLeft` - - - -`string` - - - -The padding left property. - - - -[types/css.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L38) - -
- -`paddingRight` - - - -`string` - - - -The padding right property. - - - -[types/css.ts:43](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L43) - -
- -`paddingTop` - - - -`string` - - - -The padding top property. - - - -[types/css.ts:28](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L28) - -
- -## Defined in - -[types/css.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L4) diff --git a/api/types/css/type-aliases/TypographyCSSPropertiesType.md b/api/types/css/type-aliases/TypographyCSSPropertiesType.md deleted file mode 100644 index 2380fd39..00000000 --- a/api/types/css/type-aliases/TypographyCSSPropertiesType.md +++ /dev/null @@ -1,180 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/css](../README.md) / TypographyCSSPropertiesType - -# Type Alias: TypographyCSSPropertiesType - -> **TypographyCSSPropertiesType**: `object` - -CSS properties for typography. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescriptionDefined in
- -`fontFamily` - - - -`string` - - - -The font family property. - - - -[types/css.ts:63](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L63) - -
- -`fontSize` - - - -`string` - - - -The font size property. - - - -[types/css.ts:68](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L68) - -
- -`fontStyle` - - - -`string` - - - -The font style property. - - - -[types/css.ts:73](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L73) - -
- -`fontVariationSettings` - - - -`string` - - - -The font variation settings property. - - - -[types/css.ts:78](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L78) - -
- -`fontWeight` - - - -`string` - - - -The font weight property. - - - -[types/css.ts:83](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L83) - -
- -`letterSpacing` - - - -`string` - - - -The letter spacing property. - - - -[types/css.ts:58](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L58) - -
- -`lineHeight` - - - -`string` - - - -The line height property. - - - -[types/css.ts:53](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L53) - -
- -## Defined in - -[types/css.ts:49](https://github.com/phun-ky/speccer/blob/main/src/types/css.ts#L49) diff --git a/api/types/debounce.md b/api/types/debounce.md new file mode 100644 index 00000000..b81b61fd --- /dev/null +++ b/api/types/debounce.md @@ -0,0 +1,57 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/debounce + +# types/debounce + +> Last updated 2024-08-14T10:18:52.249Z + +## Type Aliases + +### DebounceAnyFunctionType() + +```ts +type DebounceAnyFunctionType: (...args) => void; +``` + +Type definition for a debounced function that accepts any arguments. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| ...`args` | `any`[] | Arguments of any type. | + +#### Returns + +`void` + +#### Defined in + +[types/debounce.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/debounce.ts#L8) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/debounce/README.md b/api/types/debounce/README.md deleted file mode 100644 index b0f7f625..00000000 --- a/api/types/debounce/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/debounce - -# types/debounce - -## Index - -### Type Aliases - -- [DebounceAnyFunctionType](type-aliases/DebounceAnyFunctionType.md) diff --git a/api/types/debounce/type-aliases/DebounceAnyFunctionType.md b/api/types/debounce/type-aliases/DebounceAnyFunctionType.md deleted file mode 100644 index b06762c2..00000000 --- a/api/types/debounce/type-aliases/DebounceAnyFunctionType.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/debounce](../README.md) / DebounceAnyFunctionType - -# Type Alias: DebounceAnyFunctionType() - -> **DebounceAnyFunctionType**: (...`args`) => `void` - -Type definition for a debounced function that accepts any arguments. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| ...`args` | `any`[] | Arguments of any type. | - -## Returns - -`void` - -## Defined in - -[types/debounce.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/debounce.ts#L8) diff --git a/api/types/enums/area.md b/api/types/enums/area.md new file mode 100644 index 00000000..50449952 --- /dev/null +++ b/api/types/enums/area.md @@ -0,0 +1,86 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / types/enums/area + +# types/enums/area + +> Last updated 2024-08-14T10:18:52.249Z + +## Enumerations + +### DissectAreaEnum + +Enum representing different areas in Dissect. + +#### Enumeration Members + +| Enumeration Member | Value | Defined in | +| ------ | ------ | ------ | +| `Bottom` | `"bottom"` | [types/enums/area.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L23) | +| `Curly` | `"curly"` | [types/enums/area.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L26) | +| `Enclose` | `"enclose"` | [types/enums/area.ts:19](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L19) | +| `Full` | `"full"` | [types/enums/area.ts:20](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L20) | +| `Left` | `"left"` | [types/enums/area.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L21) | +| `Outline` | `"outline"` | [types/enums/area.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L18) | +| `Right` | `"right"` | [types/enums/area.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L22) | +| `SVG` | `"svg"` | [types/enums/area.ts:25](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L25) | +| `Top` | `"top"` | [types/enums/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L24) | + +*** + +### MeasureAreaEnum + +Enum representing different measurement areas. + +#### Enumeration Members + +| Enumeration Member | Value | Defined in | +| ------ | ------ | ------ | +| `Bottom` | `"bottom"` | [types/enums/area.ts:37](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L37) | +| `Height` | `"height"` | [types/enums/area.ts:34](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L34) | +| `Left` | `"left"` | [types/enums/area.ts:35](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L35) | +| `Right` | `"right"` | [types/enums/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L36) | +| `Top` | `"top"` | [types/enums/area.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L38) | +| `Width` | `"width"` | [types/enums/area.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L33) | + +*** + +### SpeccerAreaEnum + +Enum representing different areas in Speccer. + +#### Enumeration Members + +| Enumeration Member | Value | Defined in | +| ------ | ------ | ------ | +| `Bottom` | `"bottom"` | [types/enums/area.ts:10](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L10) | +| `Empty` | `""` | [types/enums/area.ts:7](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L7) | +| `Left` | `"left"` | [types/enums/area.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L8) | +| `Right` | `"right"` | [types/enums/area.ts:9](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L9) | +| `Top` | `"top"` | [types/enums/area.ts:11](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L11) | + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/enums/area/README.md b/api/types/enums/area/README.md deleted file mode 100644 index 9d5a8b1e..00000000 --- a/api/types/enums/area/README.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / types/enums/area - -# types/enums/area - -## Index - -### Enumerations - -- [DissectAreaEnum](enumerations/DissectAreaEnum.md) -- [MeasureAreaEnum](enumerations/MeasureAreaEnum.md) -- [SpeccerAreaEnum](enumerations/SpeccerAreaEnum.md) diff --git a/api/types/enums/area/enumerations/DissectAreaEnum.md b/api/types/enums/area/enumerations/DissectAreaEnum.md deleted file mode 100644 index 9f820d1f..00000000 --- a/api/types/enums/area/enumerations/DissectAreaEnum.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/enums/area](../README.md) / DissectAreaEnum - -# Enumeration: DissectAreaEnum - -Enum representing different areas in Dissect. - -## Enumeration Members - -| Enumeration Member | Value | Defined in | -| ------ | ------ | ------ | -| `Bottom` | `"bottom"` | [types/enums/area.ts:23](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L23) | -| `Curly` | `"curly"` | [types/enums/area.ts:26](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L26) | -| `Enclose` | `"enclose"` | [types/enums/area.ts:19](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L19) | -| `Full` | `"full"` | [types/enums/area.ts:20](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L20) | -| `Left` | `"left"` | [types/enums/area.ts:21](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L21) | -| `Outline` | `"outline"` | [types/enums/area.ts:18](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L18) | -| `Right` | `"right"` | [types/enums/area.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L22) | -| `SVG` | `"svg"` | [types/enums/area.ts:25](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L25) | -| `Top` | `"top"` | [types/enums/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L24) | diff --git a/api/types/enums/area/enumerations/MeasureAreaEnum.md b/api/types/enums/area/enumerations/MeasureAreaEnum.md deleted file mode 100644 index c9f1760b..00000000 --- a/api/types/enums/area/enumerations/MeasureAreaEnum.md +++ /dev/null @@ -1,20 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/enums/area](../README.md) / MeasureAreaEnum - -# Enumeration: MeasureAreaEnum - -Enum representing different measurement areas. - -## Enumeration Members - -| Enumeration Member | Value | Defined in | -| ------ | ------ | ------ | -| `Bottom` | `"bottom"` | [types/enums/area.ts:37](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L37) | -| `Height` | `"height"` | [types/enums/area.ts:34](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L34) | -| `Left` | `"left"` | [types/enums/area.ts:35](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L35) | -| `Right` | `"right"` | [types/enums/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L36) | -| `Top` | `"top"` | [types/enums/area.ts:38](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L38) | -| `Width` | `"width"` | [types/enums/area.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L33) | diff --git a/api/types/enums/area/enumerations/SpeccerAreaEnum.md b/api/types/enums/area/enumerations/SpeccerAreaEnum.md deleted file mode 100644 index 80db2f9d..00000000 --- a/api/types/enums/area/enumerations/SpeccerAreaEnum.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/enums/area](../README.md) / SpeccerAreaEnum - -# Enumeration: SpeccerAreaEnum - -Enum representing different areas in Speccer. - -## Enumeration Members - -| Enumeration Member | Value | Defined in | -| ------ | ------ | ------ | -| `Bottom` | `"bottom"` | [types/enums/area.ts:10](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L10) | -| `Empty` | `""` | [types/enums/area.ts:7](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L7) | -| `Left` | `"left"` | [types/enums/area.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L8) | -| `Right` | `"right"` | [types/enums/area.ts:9](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L9) | -| `Top` | `"top"` | [types/enums/area.ts:11](https://github.com/phun-ky/speccer/blob/main/src/types/enums/area.ts#L11) | diff --git a/api/types/interfaces/attributes.md b/api/types/interfaces/attributes.md new file mode 100644 index 00000000..726843d1 --- /dev/null +++ b/api/types/interfaces/attributes.md @@ -0,0 +1,48 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / types/interfaces/attributes + +# types/interfaces/attributes + +> Last updated 2024-08-14T10:18:52.249Z + +## Interfaces + +### AttributesMapInterface + +Interface representing a map of attributes with string keys and string values. + +This interface defines a structure for a map of attributes, where the keys are +strings (attribute names) and the values are also strings (attribute values). +It can be used to define the structure of objects that store attributes in +key-value pairs. + +#### Indexable + + \[`key`: `string`\]: `string` + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/interfaces/attributes/README.md b/api/types/interfaces/attributes/README.md deleted file mode 100644 index f234f5a4..00000000 --- a/api/types/interfaces/attributes/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / types/interfaces/attributes - -# types/interfaces/attributes - -## Index - -### Interfaces - -- [AttributesMapInterface](interfaces/AttributesMapInterface.md) diff --git a/api/types/interfaces/attributes/interfaces/AttributesMapInterface.md b/api/types/interfaces/attributes/interfaces/AttributesMapInterface.md deleted file mode 100644 index ac6e7f49..00000000 --- a/api/types/interfaces/attributes/interfaces/AttributesMapInterface.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/interfaces/attributes](../README.md) / AttributesMapInterface - -# Interface: AttributesMapInterface - -Interface representing a map of attributes with string keys and string values. - -This interface defines a structure for a map of attributes, where the keys are -strings (attribute names) and the values are also strings (attribute values). -It can be used to define the structure of objects that store attributes in -key-value pairs. - -## Indexable - - \[`key`: `string`\]: `string` diff --git a/api/types/interfaces/classnames.md b/api/types/interfaces/classnames.md new file mode 100644 index 00000000..d712da7a --- /dev/null +++ b/api/types/interfaces/classnames.md @@ -0,0 +1,61 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / types/interfaces/classnames + +# types/interfaces/classnames + +> Last updated 2024-08-14T10:18:52.250Z + +## Type Aliases + +### ClassNamesFirstArgType + +```ts +type ClassNamesFirstArgType: string | ClassNamesSecondArgType; +``` + +Type for the first argument of the cx function which can be either a string or `ClassNamesSecondArgType`. + +#### Defined in + +[types/interfaces/classnames.ts:9](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L9) + +*** + +### ClassNamesSecondArgType + +```ts +type ClassNamesSecondArgType: undefined | Record; +``` + +Type for the optional properties object with boolean values. + +#### Defined in + +[types/interfaces/classnames.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L4) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/interfaces/classnames/README.md b/api/types/interfaces/classnames/README.md deleted file mode 100644 index 460738d9..00000000 --- a/api/types/interfaces/classnames/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / types/interfaces/classnames - -# types/interfaces/classnames - -## Index - -### Type Aliases - -- [ClassNamesFirstArgType](type-aliases/ClassNamesFirstArgType.md) -- [ClassNamesSecondArgType](type-aliases/ClassNamesSecondArgType.md) diff --git a/api/types/interfaces/classnames/type-aliases/ClassNamesFirstArgType.md b/api/types/interfaces/classnames/type-aliases/ClassNamesFirstArgType.md deleted file mode 100644 index 1a8ae8c5..00000000 --- a/api/types/interfaces/classnames/type-aliases/ClassNamesFirstArgType.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/interfaces/classnames](../README.md) / ClassNamesFirstArgType - -# Type Alias: ClassNamesFirstArgType - -> **ClassNamesFirstArgType**: `string` \| [`ClassNamesSecondArgType`](ClassNamesSecondArgType.md) - -Type for the first argument of the cx function which can be either a string or `ClassNamesSecondArgType`. - -## Defined in - -[types/interfaces/classnames.ts:9](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L9) diff --git a/api/types/interfaces/classnames/type-aliases/ClassNamesSecondArgType.md b/api/types/interfaces/classnames/type-aliases/ClassNamesSecondArgType.md deleted file mode 100644 index a7552a20..00000000 --- a/api/types/interfaces/classnames/type-aliases/ClassNamesSecondArgType.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/interfaces/classnames](../README.md) / ClassNamesSecondArgType - -# Type Alias: ClassNamesSecondArgType - -> **ClassNamesSecondArgType**: `undefined` \| `Record`\<`string`, `boolean`\> - -Type for the optional properties object with boolean values. - -## Defined in - -[types/interfaces/classnames.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/classnames.ts#L4) diff --git a/api/types/interfaces/global.md b/api/types/interfaces/global.md new file mode 100644 index 00000000..ce9e8e21 --- /dev/null +++ b/api/types/interfaces/global.md @@ -0,0 +1,46 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / types/interfaces/global + +# types/interfaces/global + +> Last updated 2024-08-14T10:18:52.250Z + +## Interfaces + +### Window + +#### Properties + +| Property | Type | Description | Defined in | +| ------ | ------ | ------ | ------ | +| `DrawSVGCurlyBracket` | `any` | Represents the DrawSVGCurlyBracket class for drawing curly brackets. | [types/interfaces/global.ts:12](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L12) | +| `DrawSVGLine` | `any` | Represents the DrawSVGLine class for drawing lines. | [types/interfaces/global.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L17) | +| `SPECCER_LITERALS` | `string`[] | Represents the custom literals to be used. ![Screenshot of speccer with custom literals](https://github.com/phun-ky/speccer/blob/main/public/literals.png?raw=true) **Example** `window.SPECCER_LITERALS = [あ,い,う,え,お,か,き,く,け,こ,さ,し,す,せ,そ,た,ち,つ,て,と,な,に,ぬ,ね,の,は,ひ,ふ,へ,ほ,ま,み,む,め,も,や,ゆ,よ,ら,り,る,れ,ろ,わ,を]; speccer();` | [types/interfaces/global.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L33) | +| `speccer` | `any` | Represents the speccer object for additional functionality. | [types/interfaces/global.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L22) | + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/interfaces/global/README.md b/api/types/interfaces/global/README.md deleted file mode 100644 index 00eea7e4..00000000 --- a/api/types/interfaces/global/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / types/interfaces/global - -# types/interfaces/global - -## Index - -### Interfaces - -- [Window](interfaces/Window.md) diff --git a/api/types/interfaces/global/interfaces/Window.md b/api/types/interfaces/global/interfaces/Window.md deleted file mode 100644 index 6da7e0f2..00000000 --- a/api/types/interfaces/global/interfaces/Window.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/interfaces/global](../README.md) / Window - -# Interface: Window - -## Properties - -| Property | Type | Description | Defined in | -| ------ | ------ | ------ | ------ | -| `DrawSVGCurlyBracket` | `any` | Represents the DrawSVGCurlyBracket class for drawing curly brackets. | [types/interfaces/global.ts:12](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L12) | -| `DrawSVGLine` | `any` | Represents the DrawSVGLine class for drawing lines. | [types/interfaces/global.ts:17](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L17) | -| `SPECCER_LITERALS` | `string`[] | Represents the custom literals to be used. ![Screenshot of speccer with custom literals](https://github.com/phun-ky/speccer/blob/main/public/literals.png?raw=true) **Example** `window.SPECCER_LITERALS = [あ,い,う,え,お,か,き,く,け,こ,さ,し,す,せ,そ,た,ち,つ,て,と,な,に,ぬ,ね,の,は,ひ,ふ,へ,ほ,ま,み,む,め,も,や,ゆ,よ,ら,り,る,れ,ろ,わ,を]; speccer();` | [types/interfaces/global.ts:33](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L33) | -| `speccer` | `any` | Represents the speccer object for additional functionality. | [types/interfaces/global.ts:22](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/global.ts#L22) | diff --git a/api/types/interfaces/position.md b/api/types/interfaces/position.md new file mode 100644 index 00000000..52ab065f --- /dev/null +++ b/api/types/interfaces/position.md @@ -0,0 +1,53 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / types/interfaces/position + +# types/interfaces/position + +> Last updated 2024-08-14T10:18:52.250Z + +## Interfaces + +### GetRecPropertiesInterface + +Interface for functions that calculate position properties based on input. + +#### Properties + +| Property | Type | Description | Defined in | +| ------ | ------ | ------ | ------ | +| `absolute` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates absolute position properties. | [types/interfaces/position.ts:16](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L16) | +| `fromBottom` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving from the bottom. | [types/interfaces/position.ts:48](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L48) | +| `fromLeft` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving from the left. | [types/interfaces/position.ts:64](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L64) | +| `fromRight` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving from the right. | [types/interfaces/position.ts:80](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L80) | +| `fromTop` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving from the top. | [types/interfaces/position.ts:32](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L32) | +| `toBottom` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving to the bottom. | [types/interfaces/position.ts:40](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L40) | +| `toLeft` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving to the left. | [types/interfaces/position.ts:56](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L56) | +| `toRight` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving to the right. | [types/interfaces/position.ts:72](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L72) | +| `toTop` | (`inp`?: [`PositionInputType`](../position.md#positioninputtype)) => [`PositionPropertiesType`](../position.md#positionpropertiestype) | Calculates position properties for moving to the top. | [types/interfaces/position.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L24) | + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/interfaces/position/README.md b/api/types/interfaces/position/README.md deleted file mode 100644 index 0f9b049a..00000000 --- a/api/types/interfaces/position/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / types/interfaces/position - -# types/interfaces/position - -## Index - -### Interfaces - -- [GetRecPropertiesInterface](interfaces/GetRecPropertiesInterface.md) diff --git a/api/types/interfaces/position/interfaces/GetRecPropertiesInterface.md b/api/types/interfaces/position/interfaces/GetRecPropertiesInterface.md deleted file mode 100644 index 3281bcd0..00000000 --- a/api/types/interfaces/position/interfaces/GetRecPropertiesInterface.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [types/interfaces/position](../README.md) / GetRecPropertiesInterface - -# Interface: GetRecPropertiesInterface - -Interface for functions that calculate position properties based on input. - -## Properties - -| Property | Type | Description | Defined in | -| ------ | ------ | ------ | ------ | -| `absolute` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates absolute position properties. | [types/interfaces/position.ts:16](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L16) | -| `fromBottom` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving from the bottom. | [types/interfaces/position.ts:48](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L48) | -| `fromLeft` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving from the left. | [types/interfaces/position.ts:64](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L64) | -| `fromRight` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving from the right. | [types/interfaces/position.ts:80](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L80) | -| `fromTop` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving from the top. | [types/interfaces/position.ts:32](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L32) | -| `toBottom` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving to the bottom. | [types/interfaces/position.ts:40](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L40) | -| `toLeft` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving to the left. | [types/interfaces/position.ts:56](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L56) | -| `toRight` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving to the right. | [types/interfaces/position.ts:72](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L72) | -| `toTop` | (`inp`?: [`PositionInputType`](../../../position/type-aliases/PositionInputType.md)) => [`PositionPropertiesType`](../../../position/type-aliases/PositionPropertiesType.md) | Calculates position properties for moving to the top. | [types/interfaces/position.ts:24](https://github.com/phun-ky/speccer/blob/main/src/types/interfaces/position.ts#L24) | diff --git a/api/types/position.md b/api/types/position.md new file mode 100644 index 00000000..4f282952 --- /dev/null +++ b/api/types/position.md @@ -0,0 +1,151 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/position + +# types/position + +> Last updated 2024-08-14T10:18:52.251Z + +## Type Aliases + +### PositionInputType + +```ts +type PositionInputType: Record | { + center: boolean; + modifier: number; + sourceHeight: number; + sourceWidth: number; + targetHeight: number; + targetWidth: number; +}; +``` + +Type definition for input parameters related to positioning. + +#### Defined in + +[types/position.ts:14](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L14) + +*** + +### PositionPropertiesType + +```ts +type PositionPropertiesType: { + height: number; + left: number; + top: number; + width: number; +}; +``` + +Type definition for position properties. + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefined in
+ +`height` + + + +`number` + + + +[types/position.ts:7](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L7) + +
+ +`left` + + + +`number` + + + +[types/position.ts:6](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L6) + +
+ +`top` + + + +`number` + + + +[types/position.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L5) + +
+ +`width` + + + +`number` + + + +[types/position.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L8) + +
+ +#### Defined in + +[types/position.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L4) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/position/README.md b/api/types/position/README.md deleted file mode 100644 index dac33df4..00000000 --- a/api/types/position/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/position - -# types/position - -## Index - -### Type Aliases - -- [PositionInputType](type-aliases/PositionInputType.md) -- [PositionPropertiesType](type-aliases/PositionPropertiesType.md) diff --git a/api/types/position/type-aliases/PositionInputType.md b/api/types/position/type-aliases/PositionInputType.md deleted file mode 100644 index 7dfdee63..00000000 --- a/api/types/position/type-aliases/PositionInputType.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/position](../README.md) / PositionInputType - -# Type Alias: PositionInputType - -> **PositionInputType**: `Record`\<`string`, `never`\> \| `object` - -Type definition for input parameters related to positioning. - -## Defined in - -[types/position.ts:14](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L14) diff --git a/api/types/position/type-aliases/PositionPropertiesType.md b/api/types/position/type-aliases/PositionPropertiesType.md deleted file mode 100644 index 863cb6c6..00000000 --- a/api/types/position/type-aliases/PositionPropertiesType.md +++ /dev/null @@ -1,93 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/position](../README.md) / PositionPropertiesType - -# Type Alias: PositionPropertiesType - -> **PositionPropertiesType**: `object` - -Type definition for position properties. - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefined in
- -`height` - - - -`number` - - - -[types/position.ts:7](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L7) - -
- -`left` - - - -`number` - - - -[types/position.ts:6](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L6) - -
- -`top` - - - -`number` - - - -[types/position.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L5) - -
- -`width` - - - -`number` - - - -[types/position.ts:8](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L8) - -
- -## Defined in - -[types/position.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/position.ts#L4) diff --git a/api/types/speccer.md b/api/types/speccer.md new file mode 100644 index 00000000..81ac4785 --- /dev/null +++ b/api/types/speccer.md @@ -0,0 +1,49 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/speccer + +# types/speccer + +> Last updated 2024-08-14T10:18:52.251Z + +## Type Aliases + +### SpeccerFunctionType() + +```ts +type SpeccerFunctionType: () => void; +``` + +#### Returns + +`void` + +#### Defined in + +[types/speccer.ts:1](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L1) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/speccer/README.md b/api/types/speccer/README.md deleted file mode 100644 index b6d79dc6..00000000 --- a/api/types/speccer/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/speccer - -# types/speccer - -## Index - -### Type Aliases - -- [SpeccerFunctionType](type-aliases/SpeccerFunctionType.md) diff --git a/api/types/speccer/type-aliases/SpeccerFunctionType.md b/api/types/speccer/type-aliases/SpeccerFunctionType.md deleted file mode 100644 index a65b1c3d..00000000 --- a/api/types/speccer/type-aliases/SpeccerFunctionType.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/speccer](../README.md) / SpeccerFunctionType - -# Type Alias: SpeccerFunctionType() - -> **SpeccerFunctionType**: () => `void` - -## Returns - -`void` - -## Defined in - -[types/speccer.ts:1](https://github.com/phun-ky/speccer/blob/main/src/types/speccer.ts#L1) diff --git a/api/types/styles.md b/api/types/styles.md new file mode 100644 index 00000000..9ea8e383 --- /dev/null +++ b/api/types/styles.md @@ -0,0 +1,128 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/styles + +# types/styles + +> Last updated 2024-08-14T10:18:52.251Z + +## Type Aliases + +### SpeccerStylesReturnType + +```ts +type SpeccerStylesReturnType: { + height: string; + left: string; + top: string; + width: string; +}; +``` + +#### Type declaration + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefined in
+ +`height` + + + +`string` + + + +[types/styles.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L4) + +
+ +`left` + + + +`string` + + + +[types/styles.ts:2](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L2) + +
+ +`top` + + + +`string` + + + +[types/styles.ts:3](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L3) + +
+ +`width` + + + +`string` + + + +[types/styles.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L5) + +
+ +#### Defined in + +[types/styles.ts:1](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L1) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/styles/README.md b/api/types/styles/README.md deleted file mode 100644 index 6d6dd9dc..00000000 --- a/api/types/styles/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/styles - -# types/styles - -## Index - -### Type Aliases - -- [SpeccerStylesReturnType](type-aliases/SpeccerStylesReturnType.md) diff --git a/api/types/styles/type-aliases/SpeccerStylesReturnType.md b/api/types/styles/type-aliases/SpeccerStylesReturnType.md deleted file mode 100644 index 53c9ad98..00000000 --- a/api/types/styles/type-aliases/SpeccerStylesReturnType.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/styles](../README.md) / SpeccerStylesReturnType - -# Type Alias: SpeccerStylesReturnType - -> **SpeccerStylesReturnType**: `object` - -## Type declaration - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDefined in
- -`height` - - - -`string` - - - -[types/styles.ts:4](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L4) - -
- -`left` - - - -`string` - - - -[types/styles.ts:2](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L2) - -
- -`top` - - - -`string` - - - -[types/styles.ts:3](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L3) - -
- -`width` - - - -`string` - - - -[types/styles.ts:5](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L5) - -
- -## Defined in - -[types/styles.ts:1](https://github.com/phun-ky/speccer/blob/main/src/types/styles.ts#L1) diff --git a/api/types/xy.md b/api/types/xy.md new file mode 100644 index 00000000..0d22be65 --- /dev/null +++ b/api/types/xy.md @@ -0,0 +1,44 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / types/xy + +# types/xy + +> Last updated 2024-08-14T10:18:52.251Z + +## Interfaces + +### SpeccerCoordinatesInterface + +#### Properties + +| Property | Type | Defined in | +| ------ | ------ | ------ | +| `x` | `number` | [types/xy.ts:2](https://github.com/phun-ky/speccer/blob/main/src/types/xy.ts#L2) | +| `y` | `number` | [types/xy.ts:3](https://github.com/phun-ky/speccer/blob/main/src/types/xy.ts#L3) | + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/types/xy/README.md b/api/types/xy/README.md deleted file mode 100644 index 13166894..00000000 --- a/api/types/xy/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / types/xy - -# types/xy - -## Index - -### Interfaces - -- [SpeccerCoordinatesInterface](interfaces/SpeccerCoordinatesInterface.md) diff --git a/api/types/xy/interfaces/SpeccerCoordinatesInterface.md b/api/types/xy/interfaces/SpeccerCoordinatesInterface.md deleted file mode 100644 index 9b498ef8..00000000 --- a/api/types/xy/interfaces/SpeccerCoordinatesInterface.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [types/xy](../README.md) / SpeccerCoordinatesInterface - -# Interface: SpeccerCoordinatesInterface - -## Properties - -| Property | Type | Defined in | -| ------ | ------ | ------ | -| `x` | `number` | [types/xy.ts:2](https://github.com/phun-ky/speccer/blob/main/src/types/xy.ts#L2) | -| `y` | `number` | [types/xy.ts:3](https://github.com/phun-ky/speccer/blob/main/src/types/xy.ts#L3) | diff --git a/api/utils/angle.md b/api/utils/angle.md new file mode 100644 index 00000000..e5e2fcfd --- /dev/null +++ b/api/utils/angle.md @@ -0,0 +1,83 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/angle + +# utils/angle + +> Last updated 2024-08-14T10:18:52.251Z + +## Functions + +### angle() + +```ts +function angle( + cx, + cy, + ex, + ey, + normalize?): number +``` + +Returns the angle between two sets of coordinates. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `cx` | `number` | `undefined` | The x-coordinate of the first point. | +| `cy` | `number` | `undefined` | The y-coordinate of the first point. | +| `ex` | `number` | `undefined` | The x-coordinate of the second point. | +| `ey` | `number` | `undefined` | The y-coordinate of the second point. | +| `normalize`? | `boolean` | `true` | If the angle output should be normalized to a value between 0° and 360°. | + +#### Returns + +`number` + +The angle between the given coordinates. + +#### Throws + +Missing input for `angle`. + +#### Throws + +Parameters for `angle` do not have the required type. + +#### Example + +```ts +// Calculate the angle between two points +const angleValue = angle(0, 0, 3, 4); +``` + +#### Defined in + +[utils/angle.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/angle.ts#L20) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/angle/README.md b/api/utils/angle/README.md deleted file mode 100644 index 7d6ef839..00000000 --- a/api/utils/angle/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/angle - -# utils/angle - -## Index - -### Functions - -- [angle](functions/angle.md) diff --git a/api/utils/angle/functions/angle.md b/api/utils/angle/functions/angle.md deleted file mode 100644 index 8d41e575..00000000 --- a/api/utils/angle/functions/angle.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/angle](../README.md) / angle - -# Function: angle() - -> **angle**(`cx`, `cy`, `ex`, `ey`, `normalize`?): `number` - -Returns the angle between two sets of coordinates. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `cx` | `number` | `undefined` | The x-coordinate of the first point. | -| `cy` | `number` | `undefined` | The y-coordinate of the first point. | -| `ex` | `number` | `undefined` | The x-coordinate of the second point. | -| `ey` | `number` | `undefined` | The y-coordinate of the second point. | -| `normalize`? | `boolean` | `true` | If the angle output should be normalized to a value between 0° and 360°. | - -## Returns - -`number` - -The angle between the given coordinates. - -## Throws - -Missing input for `angle`. - -## Throws - -Parameters for `angle` do not have the required type. - -## Example - -```ts -// Calculate the angle between two points -const angleValue = angle(0, 0, 3, 4); -``` - -## Defined in - -[utils/angle.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/angle.ts#L20) diff --git a/api/utils/area.md b/api/utils/area.md new file mode 100644 index 00000000..f780fc96 --- /dev/null +++ b/api/utils/area.md @@ -0,0 +1,326 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/area + +# utils/area + +> Last updated 2024-08-14T10:18:52.251Z + +## Functions + +### getAreasFromString() + +```ts +function getAreasFromString(areaString): string[] +``` + +Splits a string containing areas into an array of strings. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`string`[] + +An array of area strings. + +#### Example + +```ts +const areas = getAreasFromString('left right top'); +// areas: ['left', 'right', 'top'] +``` + +#### Defined in + +[utils/area.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L15) + +*** + +### isBottomArea() + +```ts +function isBottomArea(areaString): boolean +``` + +Checks if 'bottom' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'bottom' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L60) + +*** + +### isCurly() + +```ts +function isCurly(areaString): boolean +``` + +Checks if the provided areaString contains 'curly' and 'full' areas. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if both 'curly' and 'full' are present, otherwise `false`. + +#### Defined in + +[utils/area.ts:129](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L129) + +*** + +### isEncloseArea() + +```ts +function isEncloseArea(areaString): boolean +``` + +Checks if 'enclose' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'enclose' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:84](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L84) + +*** + +### isFullArea() + +```ts +function isFullArea(areaString): boolean +``` + +Checks if 'full' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'full' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:72](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L72) + +*** + +### isHeightArea() + +```ts +function isHeightArea(areaString): boolean +``` + +Checks if 'height' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'height' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:96](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L96) + +*** + +### isLeftArea() + +```ts +function isLeftArea(areaString): boolean +``` + +Checks if 'left' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'left' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L24) + +*** + +### isRightArea() + +```ts +function isRightArea(areaString): boolean +``` + +Checks if 'right' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'right' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L36) + +*** + +### isTopArea() + +```ts +function isTopArea(areaString): boolean +``` + +Checks if 'top' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'top' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:48](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L48) + +*** + +### isWidthArea() + +```ts +function isWidthArea(areaString): boolean +``` + +Checks if 'width' area is present in the provided areaString. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if 'width' is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:108](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L108) + +*** + +### useSVG() + +```ts +function useSVG(areaString): boolean +``` + +Checks if the provided areaString contains SVG-related areas. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `areaString` | `string` | The string containing areas. | + +#### Returns + +`boolean` + +`true` if any SVG-related area is present, otherwise `false`. + +#### Defined in + +[utils/area.ts:120](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L120) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/area/README.md b/api/utils/area/README.md deleted file mode 100644 index 7964b091..00000000 --- a/api/utils/area/README.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/area - -# utils/area - -## Index - -### Functions - -- [getAreasFromString](functions/getAreasFromString.md) -- [isBottomArea](functions/isBottomArea.md) -- [isCurly](functions/isCurly.md) -- [isEncloseArea](functions/isEncloseArea.md) -- [isFullArea](functions/isFullArea.md) -- [isHeightArea](functions/isHeightArea.md) -- [isLeftArea](functions/isLeftArea.md) -- [isRightArea](functions/isRightArea.md) -- [isTopArea](functions/isTopArea.md) -- [isWidthArea](functions/isWidthArea.md) -- [useSVG](functions/useSVG.md) diff --git a/api/utils/area/functions/getAreasFromString.md b/api/utils/area/functions/getAreasFromString.md deleted file mode 100644 index e006c5bb..00000000 --- a/api/utils/area/functions/getAreasFromString.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / getAreasFromString - -# Function: getAreasFromString() - -> **getAreasFromString**(`areaString`): `string`[] - -Splits a string containing areas into an array of strings. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`string`[] - -An array of area strings. - -## Example - -```ts -const areas = getAreasFromString('left right top'); -// areas: ['left', 'right', 'top'] -``` - -## Defined in - -[utils/area.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L15) diff --git a/api/utils/area/functions/isBottomArea.md b/api/utils/area/functions/isBottomArea.md deleted file mode 100644 index 5b95bab4..00000000 --- a/api/utils/area/functions/isBottomArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isBottomArea - -# Function: isBottomArea() - -> **isBottomArea**(`areaString`): `boolean` - -Checks if 'bottom' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'bottom' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L60) diff --git a/api/utils/area/functions/isCurly.md b/api/utils/area/functions/isCurly.md deleted file mode 100644 index 02f2c70f..00000000 --- a/api/utils/area/functions/isCurly.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isCurly - -# Function: isCurly() - -> **isCurly**(`areaString`): `boolean` - -Checks if the provided areaString contains 'curly' and 'full' areas. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if both 'curly' and 'full' are present, otherwise `false`. - -## Defined in - -[utils/area.ts:129](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L129) diff --git a/api/utils/area/functions/isEncloseArea.md b/api/utils/area/functions/isEncloseArea.md deleted file mode 100644 index 8ca4d6ec..00000000 --- a/api/utils/area/functions/isEncloseArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isEncloseArea - -# Function: isEncloseArea() - -> **isEncloseArea**(`areaString`): `boolean` - -Checks if 'enclose' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'enclose' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:84](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L84) diff --git a/api/utils/area/functions/isFullArea.md b/api/utils/area/functions/isFullArea.md deleted file mode 100644 index 44ec371d..00000000 --- a/api/utils/area/functions/isFullArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isFullArea - -# Function: isFullArea() - -> **isFullArea**(`areaString`): `boolean` - -Checks if 'full' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'full' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:72](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L72) diff --git a/api/utils/area/functions/isHeightArea.md b/api/utils/area/functions/isHeightArea.md deleted file mode 100644 index 043e5711..00000000 --- a/api/utils/area/functions/isHeightArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isHeightArea - -# Function: isHeightArea() - -> **isHeightArea**(`areaString`): `boolean` - -Checks if 'height' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'height' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:96](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L96) diff --git a/api/utils/area/functions/isLeftArea.md b/api/utils/area/functions/isLeftArea.md deleted file mode 100644 index 5d1314ab..00000000 --- a/api/utils/area/functions/isLeftArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isLeftArea - -# Function: isLeftArea() - -> **isLeftArea**(`areaString`): `boolean` - -Checks if 'left' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'left' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:24](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L24) diff --git a/api/utils/area/functions/isRightArea.md b/api/utils/area/functions/isRightArea.md deleted file mode 100644 index 9b5b5563..00000000 --- a/api/utils/area/functions/isRightArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isRightArea - -# Function: isRightArea() - -> **isRightArea**(`areaString`): `boolean` - -Checks if 'right' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'right' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:36](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L36) diff --git a/api/utils/area/functions/isTopArea.md b/api/utils/area/functions/isTopArea.md deleted file mode 100644 index 333fe489..00000000 --- a/api/utils/area/functions/isTopArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isTopArea - -# Function: isTopArea() - -> **isTopArea**(`areaString`): `boolean` - -Checks if 'top' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'top' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:48](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L48) diff --git a/api/utils/area/functions/isWidthArea.md b/api/utils/area/functions/isWidthArea.md deleted file mode 100644 index b507dfbf..00000000 --- a/api/utils/area/functions/isWidthArea.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / isWidthArea - -# Function: isWidthArea() - -> **isWidthArea**(`areaString`): `boolean` - -Checks if 'width' area is present in the provided areaString. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if 'width' is present, otherwise `false`. - -## Defined in - -[utils/area.ts:108](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L108) diff --git a/api/utils/area/functions/useSVG.md b/api/utils/area/functions/useSVG.md deleted file mode 100644 index c2935d66..00000000 --- a/api/utils/area/functions/useSVG.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/area](../README.md) / useSVG - -# Function: useSVG() - -> **useSVG**(`areaString`): `boolean` - -Checks if the provided areaString contains SVG-related areas. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `areaString` | `string` | The string containing areas. | - -## Returns - -`boolean` - -`true` if any SVG-related area is present, otherwise `false`. - -## Defined in - -[utils/area.ts:120](https://github.com/phun-ky/speccer/blob/main/src/utils/area.ts#L120) diff --git a/api/utils/attributes.md b/api/utils/attributes.md new file mode 100644 index 00000000..b5be3850 --- /dev/null +++ b/api/utils/attributes.md @@ -0,0 +1,100 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/attributes + +# utils/attributes + +> Last updated 2024-08-14T10:18:52.252Z + +## Functions + +### removeAttributes() + +```ts +function removeAttributes(el, attrs?): void +``` + +Removes attributes from an HTML element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTML element to remove attributes from. | +| `attrs`? | `string`[] | The attributes to remove as a key-value mapping. | + +#### Returns + +`void` + +#### Example + +```ts +const element = document.getElementById('myElement'); +removeAttributes(element, ['class', 'data-value']); +``` + +#### Defined in + +[utils/attributes.ts:44](https://github.com/phun-ky/speccer/blob/main/src/utils/attributes.ts#L44) + +*** + +### setAttributes() + +```ts +function setAttributes(el, attrs?): void +``` + +Sets attributes on an HTML element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTML element to set attributes on. | +| `attrs`? | [`AttributesMapInterface`](../types/interfaces/attributes.md#attributesmapinterface) | The attributes to set as a key-value mapping. | + +#### Returns + +`void` + +#### Example + +```ts +const element = document.getElementById('myElement'); +setAttributes(element, { + 'class': 'active', + 'data-value': '123', +}); +``` + +#### Defined in + +[utils/attributes.ts:19](https://github.com/phun-ky/speccer/blob/main/src/utils/attributes.ts#L19) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/attributes/README.md b/api/utils/attributes/README.md deleted file mode 100644 index ee5e4020..00000000 --- a/api/utils/attributes/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/attributes - -# utils/attributes - -## Index - -### Functions - -- [removeAttributes](functions/removeAttributes.md) -- [setAttributes](functions/setAttributes.md) diff --git a/api/utils/attributes/functions/removeAttributes.md b/api/utils/attributes/functions/removeAttributes.md deleted file mode 100644 index 4e72c87f..00000000 --- a/api/utils/attributes/functions/removeAttributes.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/attributes](../README.md) / removeAttributes - -# Function: removeAttributes() - -> **removeAttributes**(`el`, `attrs`?): `void` - -Removes attributes from an HTML element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTML element to remove attributes from. | -| `attrs`? | `string`[] | The attributes to remove as a key-value mapping. | - -## Returns - -`void` - -## Example - -```ts -const element = document.getElementById('myElement'); -removeAttributes(element, ['class', 'data-value']); -``` - -## Defined in - -[utils/attributes.ts:44](https://github.com/phun-ky/speccer/blob/main/src/utils/attributes.ts#L44) diff --git a/api/utils/attributes/functions/setAttributes.md b/api/utils/attributes/functions/setAttributes.md deleted file mode 100644 index 64687dbb..00000000 --- a/api/utils/attributes/functions/setAttributes.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/attributes](../README.md) / setAttributes - -# Function: setAttributes() - -> **setAttributes**(`el`, `attrs`?): `void` - -Sets attributes on an HTML element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTML element to set attributes on. | -| `attrs`? | [`AttributesMapInterface`](../../../types/interfaces/attributes/interfaces/AttributesMapInterface.md) | The attributes to set as a key-value mapping. | - -## Returns - -`void` - -## Example - -```ts -const element = document.getElementById('myElement'); -setAttributes(element, { - 'class': 'active', - 'data-value': '123', -}); -``` - -## Defined in - -[utils/attributes.ts:19](https://github.com/phun-ky/speccer/blob/main/src/utils/attributes.ts#L19) diff --git a/api/utils/bezier.md b/api/utils/bezier.md new file mode 100644 index 00000000..3ffc8f82 --- /dev/null +++ b/api/utils/bezier.md @@ -0,0 +1,298 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/bezier + +# utils/bezier + +> Last updated 2024-08-14T10:18:52.252Z + +## Functions + +### createBezierCurveCoordinates() + +```ts +function createBezierCurveCoordinates(coords, options): { + firstControl: { + x: number; + y: y1; + }; + firstPoint: { + x: x1; + y: y1; + }; + lastControl: { + x: number; + y: y2; + }; + lastPoint: { + x: x2; + y: y2; + }; +} +``` + +Calculates coordinates for a Bezier curve between two points. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `coords` | [`CreateCoordinatesForCurveCoordParamType`](../types/bezier.md#createcoordinatesforcurvecoordparamtype) | The coordinates of the start and end points. | +| `options` | [`CreateCoordinatesForCurveOptionsParamType`](../types/bezier.md#createcoordinatesforcurveoptionsparamtype) | Options for controlling the curve's shape. | + +#### Returns + +```ts +{ + firstControl: { + x: number; + y: y1; + }; + firstPoint: { + x: x1; + y: y1; + }; + lastControl: { + x: number; + y: y2; + }; + lastPoint: { + x: x2; + y: y2; + }; +} +``` + +Coordinates for the Bezier curve. + +| Name | Type | Default value | Defined in | +| ------ | ------ | ------ | ------ | +| `firstControl` | \{ `x`: `number`; `y`: `y1`; \} | - | [utils/bezier.ts:71](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L71) | +| `firstControl.x` | `number` | - | [utils/bezier.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L34) | +| `firstControl.y` | `number` | y1 | [utils/bezier.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L34) | +| `firstPoint` | \{ `x`: `x1`; `y`: `y1`; \} | - | [utils/bezier.ts:70](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L70) | +| `firstPoint.x` | `number` | x1 | [utils/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L31) | +| `firstPoint.y` | `number` | y1 | [utils/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L31) | +| `lastControl` | \{ `x`: `number`; `y`: `y2`; \} | - | [utils/bezier.ts:73](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L73) | +| `lastControl.x` | `number` | - | [utils/bezier.ts:35](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L35) | +| `lastControl.y` | `number` | y2 | [utils/bezier.ts:35](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L35) | +| `lastPoint` | \{ `x`: `x2`; `y`: `y2`; \} | - | [utils/bezier.ts:72](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L72) | +| `lastPoint.x` | `number` | x2 | [utils/bezier.ts:32](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L32) | +| `lastPoint.y` | `number` | y2 | [utils/bezier.ts:32](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L32) | + +#### Example + +```ts +const coordinates = createBezierCurveCoordinates( + { x1: 0, x2: 100, y1: 0, y2: 100 }, + { direct: true, firstSet: true, direction: 'west' } +); +``` + +#### Defined in + +[utils/bezier.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L25) + +*** + +### getCurlySVGPath() + +```ts +function getCurlySVGPath( + startEl, + stopEl, +options): Promise +``` + +Generates an SVG path for a curved line between two HTML elements. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `startEl` | `HTMLElement` | The starting HTML element. | +| `stopEl` | `HTMLElement` | The ending HTML element. | +| `options` | [`CurlyBezierPathOptionsType`](../types/bezier.md#curlybezierpathoptionstype) | Options for controlling the curved line. | + +#### Returns + +`Promise`\<`string`\> + +The SVG path string for the curved line. + +#### Example + +```ts +const svgPath = getCurlySVGPath(startElement, stopElement, { + pos1: 'top', + pos2: 'bottom', + firstSet: true, + direction: 'south', +}); +``` + +#### Defined in + +[utils/bezier.ts:95](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L95) + +*** + +### getPositionsForCurlySVGPath() + +```ts +function getPositionsForCurlySVGPath(direction): { + path1pos1: string; + path1pos2: string; + path2pos1: string; + path2pos2: string; +} +``` + +Returns positions for creating an SVG path for a curved line based on a cardinal direction. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `direction` | `string` | The cardinal direction ('east', 'west', 'south', 'north'). | + +#### Returns + +```ts +{ + path1pos1: string; + path1pos2: string; + path2pos1: string; + path2pos2: string; +} +``` + +Positions for creating an SVG path for a curved line. + +| Name | Type | Defined in | +| ------ | ------ | ------ | +| `path1pos1` | `string` | [utils/bezier.ts:261](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L261) | +| `path1pos2` | `string` | [utils/bezier.ts:262](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L262) | +| `path2pos1` | `string` | [utils/bezier.ts:263](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L263) | +| `path2pos2` | `string` | [utils/bezier.ts:264](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L264) | + +#### Example + +```ts +const positions = getPositionsForCurlySVGPath('west'); +``` + +#### Defined in + +[utils/bezier.ts:226](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L226) + +*** + +### getPositionsForSVGPath() + +```ts +function getPositionsForSVGPath(direction): { + pos1: string; + pos2: string; +} +``` + +Returns positions for creating an SVG path based on a cardinal direction. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `direction` | `string` | The cardinal direction ('east', 'west', 'south', 'north'). | + +#### Returns + +```ts +{ + pos1: string; + pos2: string; +} +``` + +Positions for creating an SVG path. + +| Name | Type | Defined in | +| ------ | ------ | ------ | +| `pos1` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | +| `pos2` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | + +#### Example + +```ts +const positions = getPositionsForSVGPath('east'); +``` + +#### Defined in + +[utils/bezier.ts:188](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L188) + +*** + +### getSVGPath() + +```ts +function getSVGPath( + startEl, + stopEl, +options): Promise +``` + +Generates an SVG path for a straight line between two HTML elements. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `startEl` | `HTMLElement` | The starting HTML element. | +| `stopEl` | `HTMLElement` | The ending HTML element. | +| `options` | [`BezierPathOptionsType`](../types/bezier.md#bezierpathoptionstype) | Options for controlling the straight line. | + +#### Returns + +`Promise`\<`string`\> + +The SVG path string for the straight line. + +#### Example + +```ts +const svgPath = getSVGPath(startElement, stopElement, { + pos1: 'left', + pos2: 'right', +}); +``` + +#### Defined in + +[utils/bezier.ts:156](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L156) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/bezier/README.md b/api/utils/bezier/README.md deleted file mode 100644 index f37c0910..00000000 --- a/api/utils/bezier/README.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/bezier - -# utils/bezier - -## Index - -### Functions - -- [createBezierCurveCoordinates](functions/createBezierCurveCoordinates.md) -- [getCurlySVGPath](functions/getCurlySVGPath.md) -- [getPositionsForCurlySVGPath](functions/getPositionsForCurlySVGPath.md) -- [getPositionsForSVGPath](functions/getPositionsForSVGPath.md) -- [getSVGPath](functions/getSVGPath.md) diff --git a/api/utils/bezier/functions/createBezierCurveCoordinates.md b/api/utils/bezier/functions/createBezierCurveCoordinates.md deleted file mode 100644 index 20308bec..00000000 --- a/api/utils/bezier/functions/createBezierCurveCoordinates.md +++ /dev/null @@ -1,52 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/bezier](../README.md) / createBezierCurveCoordinates - -# Function: createBezierCurveCoordinates() - -> **createBezierCurveCoordinates**(`coords`, `options`): `object` - -Calculates coordinates for a Bezier curve between two points. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `coords` | [`CreateCoordinatesForCurveCoordParamType`](../../../types/bezier/type-aliases/CreateCoordinatesForCurveCoordParamType.md) | The coordinates of the start and end points. | -| `options` | [`CreateCoordinatesForCurveOptionsParamType`](../../../types/bezier/type-aliases/CreateCoordinatesForCurveOptionsParamType.md) | Options for controlling the curve's shape. | - -## Returns - -`object` - -Coordinates for the Bezier curve. - -| Name | Type | Default value | Defined in | -| ------ | ------ | ------ | ------ | -| `firstControl` | `object` | - | [utils/bezier.ts:71](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L71) | -| `firstControl.x` | `number` | - | [utils/bezier.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L34) | -| `firstControl.y` | `number` | y1 | [utils/bezier.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L34) | -| `firstPoint` | `object` | - | [utils/bezier.ts:70](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L70) | -| `firstPoint.x` | `number` | x1 | [utils/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L31) | -| `firstPoint.y` | `number` | y1 | [utils/bezier.ts:31](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L31) | -| `lastControl` | `object` | - | [utils/bezier.ts:73](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L73) | -| `lastControl.x` | `number` | - | [utils/bezier.ts:35](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L35) | -| `lastControl.y` | `number` | y2 | [utils/bezier.ts:35](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L35) | -| `lastPoint` | `object` | - | [utils/bezier.ts:72](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L72) | -| `lastPoint.x` | `number` | x2 | [utils/bezier.ts:32](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L32) | -| `lastPoint.y` | `number` | y2 | [utils/bezier.ts:32](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L32) | - -## Example - -```ts -const coordinates = createBezierCurveCoordinates( - { x1: 0, x2: 100, y1: 0, y2: 100 }, - { direct: true, firstSet: true, direction: 'west' } -); -``` - -## Defined in - -[utils/bezier.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L25) diff --git a/api/utils/bezier/functions/getCurlySVGPath.md b/api/utils/bezier/functions/getCurlySVGPath.md deleted file mode 100644 index a6178d20..00000000 --- a/api/utils/bezier/functions/getCurlySVGPath.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/bezier](../README.md) / getCurlySVGPath - -# Function: getCurlySVGPath() - -> **getCurlySVGPath**(`startEl`, `stopEl`, `options`): `Promise`\<`string`\> - -Generates an SVG path for a curved line between two HTML elements. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `startEl` | `HTMLElement` | The starting HTML element. | -| `stopEl` | `HTMLElement` | The ending HTML element. | -| `options` | [`CurlyBezierPathOptionsType`](../../../types/bezier/type-aliases/CurlyBezierPathOptionsType.md) | Options for controlling the curved line. | - -## Returns - -`Promise`\<`string`\> - -The SVG path string for the curved line. - -## Example - -```ts -const svgPath = getCurlySVGPath(startElement, stopElement, { - pos1: 'top', - pos2: 'bottom', - firstSet: true, - direction: 'south', -}); -``` - -## Defined in - -[utils/bezier.ts:95](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L95) diff --git a/api/utils/bezier/functions/getPositionsForCurlySVGPath.md b/api/utils/bezier/functions/getPositionsForCurlySVGPath.md deleted file mode 100644 index e98fd210..00000000 --- a/api/utils/bezier/functions/getPositionsForCurlySVGPath.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/bezier](../README.md) / getPositionsForCurlySVGPath - -# Function: getPositionsForCurlySVGPath() - -> **getPositionsForCurlySVGPath**(`direction`): `object` - -Returns positions for creating an SVG path for a curved line based on a cardinal direction. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `direction` | `string` | The cardinal direction ('east', 'west', 'south', 'north'). | - -## Returns - -`object` - -Positions for creating an SVG path for a curved line. - -| Name | Type | Defined in | -| ------ | ------ | ------ | -| `path1pos1` | `string` | [utils/bezier.ts:261](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L261) | -| `path1pos2` | `string` | [utils/bezier.ts:262](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L262) | -| `path2pos1` | `string` | [utils/bezier.ts:263](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L263) | -| `path2pos2` | `string` | [utils/bezier.ts:264](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L264) | - -## Example - -```ts -const positions = getPositionsForCurlySVGPath('west'); -``` - -## Defined in - -[utils/bezier.ts:226](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L226) diff --git a/api/utils/bezier/functions/getPositionsForSVGPath.md b/api/utils/bezier/functions/getPositionsForSVGPath.md deleted file mode 100644 index f8c0894a..00000000 --- a/api/utils/bezier/functions/getPositionsForSVGPath.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/bezier](../README.md) / getPositionsForSVGPath - -# Function: getPositionsForSVGPath() - -> **getPositionsForSVGPath**(`direction`): `object` - -Returns positions for creating an SVG path based on a cardinal direction. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `direction` | `string` | The cardinal direction ('east', 'west', 'south', 'north'). | - -## Returns - -`object` - -Positions for creating an SVG path. - -| Name | Type | Defined in | -| ------ | ------ | ------ | -| `pos1` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | -| `pos2` | `string` | [utils/bezier.ts:212](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L212) | - -## Example - -```ts -const positions = getPositionsForSVGPath('east'); -``` - -## Defined in - -[utils/bezier.ts:188](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L188) diff --git a/api/utils/bezier/functions/getSVGPath.md b/api/utils/bezier/functions/getSVGPath.md deleted file mode 100644 index 517de8b4..00000000 --- a/api/utils/bezier/functions/getSVGPath.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/bezier](../README.md) / getSVGPath - -# Function: getSVGPath() - -> **getSVGPath**(`startEl`, `stopEl`, `options`): `Promise`\<`string`\> - -Generates an SVG path for a straight line between two HTML elements. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `startEl` | `HTMLElement` | The starting HTML element. | -| `stopEl` | `HTMLElement` | The ending HTML element. | -| `options` | [`BezierPathOptionsType`](../../../types/bezier/type-aliases/BezierPathOptionsType.md) | Options for controlling the straight line. | - -## Returns - -`Promise`\<`string`\> - -The SVG path string for the straight line. - -## Example - -```ts -const svgPath = getSVGPath(startElement, stopElement, { - pos1: 'left', - pos2: 'right', -}); -``` - -## Defined in - -[utils/bezier.ts:156](https://github.com/phun-ky/speccer/blob/main/src/utils/bezier.ts#L156) diff --git a/api/utils/camel-case.md b/api/utils/camel-case.md new file mode 100644 index 00000000..f540c40d --- /dev/null +++ b/api/utils/camel-case.md @@ -0,0 +1,59 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/camel-case + +# utils/camel-case + +> Last updated 2024-08-14T10:18:52.253Z + +## Functions + +### camelCase() + +```ts +function camelCase(str): string +``` + +Converts a string to camel case. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `str` | `string` | The input string. | + +#### Returns + +`string` + +- The string converted to camel case. + +#### Defined in + +[utils/camel-case.ts:6](https://github.com/phun-ky/speccer/blob/main/src/utils/camel-case.ts#L6) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/camel-case/README.md b/api/utils/camel-case/README.md deleted file mode 100644 index e8ae1bcc..00000000 --- a/api/utils/camel-case/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/camel-case - -# utils/camel-case - -## Index - -### Functions - -- [camelCase](functions/camelCase.md) diff --git a/api/utils/camel-case/functions/camelCase.md b/api/utils/camel-case/functions/camelCase.md deleted file mode 100644 index ebb6fc7b..00000000 --- a/api/utils/camel-case/functions/camelCase.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/camel-case](../README.md) / camelCase - -# Function: camelCase() - -> **camelCase**(`str`): `string` - -Converts a string to camel case. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `str` | `string` | The input string. | - -## Returns - -`string` - -- The string converted to camel case. - -## Defined in - -[utils/camel-case.ts:6](https://github.com/phun-ky/speccer/blob/main/src/utils/camel-case.ts#L6) diff --git a/api/utils/cardinal.md b/api/utils/cardinal.md new file mode 100644 index 00000000..ba83b7b4 --- /dev/null +++ b/api/utils/cardinal.md @@ -0,0 +1,119 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/cardinal + +# utils/cardinal + +> Last updated 2024-08-14T10:18:52.253Z + +## Functions + +### cardinal\_direction() + +```ts +function cardinal_direction(degrees): string +``` + +Gives you the cardinal direction based on degrees. +Note: The degrees start at 0, which is EAST (originally, north should be 0, but here, north is 270), +and we travel clockwise. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `degrees` | `number` | The angle in degrees. | + +#### Returns + +`string` + +- The cardinal direction. + +#### Throws + +Parameter cannot exceed 360. + +#### Throws + +Parameter cannot be lower than 0. + +#### Example + +```ts +// Get the cardinal direction for an angle in degrees +const direction = cardinal_direction(45); +``` + +#### Defined in + +[utils/cardinal.ts:18](https://github.com/phun-ky/speccer/blob/main/src/utils/cardinal.ts#L18) + +*** + +### cardinal\_direction\_crude() + +```ts +function cardinal_direction_crude(degrees): string +``` + +Gives you the cardinal direction based on degrees (crude version). +Note: The degrees start at 0, which is EAST (originally, north should be 0, but here, north is 270), +and we travel clockwise. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `degrees` | `number` | The angle in degrees. | + +#### Returns + +`string` + +- The cardinal direction (NSEW). + +#### Throws + +Parameter cannot exceed 360. + +#### Throws + +Parameter cannot be lower than 0. + +#### Example + +```ts +// Get the cardinal direction (crude) for an angle in degrees +const direction = cardinal_direction_crude(45); +``` + +#### Defined in + +[utils/cardinal.ts:57](https://github.com/phun-ky/speccer/blob/main/src/utils/cardinal.ts#L57) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/cardinal/README.md b/api/utils/cardinal/README.md deleted file mode 100644 index dabd9780..00000000 --- a/api/utils/cardinal/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/cardinal - -# utils/cardinal - -## Index - -### Functions - -- [cardinal\_direction](functions/cardinal_direction.md) -- [cardinal\_direction\_crude](functions/cardinal_direction_crude.md) diff --git a/api/utils/cardinal/functions/cardinal_direction.md b/api/utils/cardinal/functions/cardinal_direction.md deleted file mode 100644 index d504c5ea..00000000 --- a/api/utils/cardinal/functions/cardinal_direction.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/cardinal](../README.md) / cardinal\_direction - -# Function: cardinal\_direction() - -> **cardinal\_direction**(`degrees`): `string` - -Gives you the cardinal direction based on degrees. -Note: The degrees start at 0, which is EAST (originally, north should be 0, but here, north is 270), -and we travel clockwise. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `degrees` | `number` | The angle in degrees. | - -## Returns - -`string` - -- The cardinal direction. - -## Throws - -Parameter cannot exceed 360. - -## Throws - -Parameter cannot be lower than 0. - -## Example - -```ts -// Get the cardinal direction for an angle in degrees -const direction = cardinal_direction(45); -``` - -## Defined in - -[utils/cardinal.ts:18](https://github.com/phun-ky/speccer/blob/main/src/utils/cardinal.ts#L18) diff --git a/api/utils/cardinal/functions/cardinal_direction_crude.md b/api/utils/cardinal/functions/cardinal_direction_crude.md deleted file mode 100644 index 147ab685..00000000 --- a/api/utils/cardinal/functions/cardinal_direction_crude.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/cardinal](../README.md) / cardinal\_direction\_crude - -# Function: cardinal\_direction\_crude() - -> **cardinal\_direction\_crude**(`degrees`): `string` - -Gives you the cardinal direction based on degrees (crude version). -Note: The degrees start at 0, which is EAST (originally, north should be 0, but here, north is 270), -and we travel clockwise. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `degrees` | `number` | The angle in degrees. | - -## Returns - -`string` - -- The cardinal direction (NSEW). - -## Throws - -Parameter cannot exceed 360. - -## Throws - -Parameter cannot be lower than 0. - -## Example - -```ts -// Get the cardinal direction (crude) for an angle in degrees -const direction = cardinal_direction_crude(45); -``` - -## Defined in - -[utils/cardinal.ts:57](https://github.com/phun-ky/speccer/blob/main/src/utils/cardinal.ts#L57) diff --git a/api/utils/classes/DrawSVGCurlyBracket.md b/api/utils/classes/DrawSVGCurlyBracket.md new file mode 100644 index 00000000..9e5ccacb --- /dev/null +++ b/api/utils/classes/DrawSVGCurlyBracket.md @@ -0,0 +1,117 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / utils/classes/DrawSVGCurlyBracket + +# utils/classes/DrawSVGCurlyBracket + +> Last updated 2024-08-14T10:18:52.253Z + +## Classes + +### DrawSVGCurlyBracket + +Class representing a DrawSVGCurlyBracket instance. + +#### Constructors + +##### new DrawSVGCurlyBracket() + +```ts +new DrawSVGCurlyBracket(startElement, stopElement): DrawSVGCurlyBracket +``` + +Creates a new DrawSVGCurlyBracket instance. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `startElement` | `HTMLElement` | The starting element for the bracket. | +| `stopElement` | `HTMLElement` | The ending element for the bracket. | + +###### Returns + +[`DrawSVGCurlyBracket`](DrawSVGCurlyBracket.md#drawsvgcurlybracket) + +###### Defined in + +[utils/classes/DrawSVGCurlyBracket.ts:22](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L22) + +#### Properties + +| Property | Type | Defined in | +| ------ | ------ | ------ | +| `firstPathElement` | `SVGPathElement` | [utils/classes/DrawSVGCurlyBracket.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L14) | +| `secondPathElement` | `SVGPathElement` | [utils/classes/DrawSVGCurlyBracket.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L15) | +| `startElement` | `HTMLElement` | [utils/classes/DrawSVGCurlyBracket.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L12) | +| `stopElement` | `HTMLElement` | [utils/classes/DrawSVGCurlyBracket.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L13) | + +#### Methods + +##### connect() + +```ts +connect(): void +``` + +Connects and draws the curly bracket. + +###### Returns + +`void` + +###### Defined in + +[utils/classes/DrawSVGCurlyBracket.ts:67](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L67) + +##### draw() + +```ts +draw(path): Promise +``` + +Draws the curly bracket based on the provided path. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `path` | `SVGPathElement` | The SVGPathElement to be used as the base path. | + +###### Returns + +`Promise`\<`void`\> + +###### Throws + +Will throw an error if no path is provided. + +###### Defined in + +[utils/classes/DrawSVGCurlyBracket.ts:101](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L101) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/classes/DrawSVGCurlyBracket/README.md b/api/utils/classes/DrawSVGCurlyBracket/README.md deleted file mode 100644 index 3538c848..00000000 --- a/api/utils/classes/DrawSVGCurlyBracket/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / utils/classes/DrawSVGCurlyBracket - -# utils/classes/DrawSVGCurlyBracket - -## Index - -### Classes - -- [DrawSVGCurlyBracket](classes/DrawSVGCurlyBracket.md) diff --git a/api/utils/classes/DrawSVGCurlyBracket/classes/DrawSVGCurlyBracket.md b/api/utils/classes/DrawSVGCurlyBracket/classes/DrawSVGCurlyBracket.md deleted file mode 100644 index dfe37a3a..00000000 --- a/api/utils/classes/DrawSVGCurlyBracket/classes/DrawSVGCurlyBracket.md +++ /dev/null @@ -1,83 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [utils/classes/DrawSVGCurlyBracket](../README.md) / DrawSVGCurlyBracket - -# Class: DrawSVGCurlyBracket - -Class representing a DrawSVGCurlyBracket instance. - -## Constructors - -### new DrawSVGCurlyBracket() - -> **new DrawSVGCurlyBracket**(`startElement`, `stopElement`): [`DrawSVGCurlyBracket`](DrawSVGCurlyBracket.md) - -Creates a new DrawSVGCurlyBracket instance. - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `startElement` | `HTMLElement` | The starting element for the bracket. | -| `stopElement` | `HTMLElement` | The ending element for the bracket. | - -#### Returns - -[`DrawSVGCurlyBracket`](DrawSVGCurlyBracket.md) - -#### Defined in - -[utils/classes/DrawSVGCurlyBracket.ts:22](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L22) - -## Properties - -| Property | Type | Defined in | -| ------ | ------ | ------ | -| `firstPathElement` | `SVGPathElement` | [utils/classes/DrawSVGCurlyBracket.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L14) | -| `secondPathElement` | `SVGPathElement` | [utils/classes/DrawSVGCurlyBracket.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L15) | -| `startElement` | `HTMLElement` | [utils/classes/DrawSVGCurlyBracket.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L12) | -| `stopElement` | `HTMLElement` | [utils/classes/DrawSVGCurlyBracket.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L13) | - -## Methods - -### connect() - -> **connect**(): `void` - -Connects and draws the curly bracket. - -#### Returns - -`void` - -#### Defined in - -[utils/classes/DrawSVGCurlyBracket.ts:67](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L67) - -*** - -### draw() - -> **draw**(`path`): `Promise`\<`void`\> - -Draws the curly bracket based on the provided path. - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `path` | `SVGPathElement` | The SVGPathElement to be used as the base path. | - -#### Returns - -`Promise`\<`void`\> - -#### Throws - -Will throw an error if no path is provided. - -#### Defined in - -[utils/classes/DrawSVGCurlyBracket.ts:101](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGCurlyBracket.ts#L101) diff --git a/api/utils/classes/DrawSVGLine.md b/api/utils/classes/DrawSVGLine.md new file mode 100644 index 00000000..4d03b82a --- /dev/null +++ b/api/utils/classes/DrawSVGLine.md @@ -0,0 +1,116 @@ +SPECCER logo + +[@phun-ky/speccer](../../README.md) / utils/classes/DrawSVGLine + +# utils/classes/DrawSVGLine + +> Last updated 2024-08-14T10:18:52.254Z + +## Classes + +### DrawSVGLine + +Class representing a DrawSVGLine instance. + +#### Constructors + +##### new DrawSVGLine() + +```ts +new DrawSVGLine(startElement, stopElement): DrawSVGLine +``` + +Creates a new DrawSVGLine instance. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `startElement` | `HTMLElement` | The starting element for the line. | +| `stopElement` | `HTMLElement` | The ending element for the line. | + +###### Returns + +[`DrawSVGLine`](DrawSVGLine.md#drawsvgline) + +###### Defined in + +[utils/classes/DrawSVGLine.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L21) + +#### Properties + +| Property | Type | Defined in | +| ------ | ------ | ------ | +| `line` | `SVGPathElement` | [utils/classes/DrawSVGLine.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L14) | +| `startElement` | `HTMLElement` | [utils/classes/DrawSVGLine.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L12) | +| `stopElement` | `HTMLElement` | [utils/classes/DrawSVGLine.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L13) | + +#### Methods + +##### connect() + +```ts +connect(): void +``` + +Connects and draws the line. + +###### Returns + +`void` + +###### Defined in + +[utils/classes/DrawSVGLine.ts:66](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L66) + +##### draw() + +```ts +draw(path): Promise +``` + +Draws the line based on the provided path. + +###### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `path` | `SVGPathElement` | The SVGPathElement to be used as the base path. | + +###### Returns + +`Promise`\<`void`\> + +###### Throws + +Will throw an error if no path is provided. + +###### Defined in + +[utils/classes/DrawSVGLine.ts:75](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L75) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/classes/DrawSVGLine/README.md b/api/utils/classes/DrawSVGLine/README.md deleted file mode 100644 index b4a191c7..00000000 --- a/api/utils/classes/DrawSVGLine/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / utils/classes/DrawSVGLine - -# utils/classes/DrawSVGLine - -## Index - -### Classes - -- [DrawSVGLine](classes/DrawSVGLine.md) diff --git a/api/utils/classes/DrawSVGLine/classes/DrawSVGLine.md b/api/utils/classes/DrawSVGLine/classes/DrawSVGLine.md deleted file mode 100644 index 7516c90d..00000000 --- a/api/utils/classes/DrawSVGLine/classes/DrawSVGLine.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@phun-ky/speccer**](../../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../../README.md) / [utils/classes/DrawSVGLine](../README.md) / DrawSVGLine - -# Class: DrawSVGLine - -Class representing a DrawSVGLine instance. - -## Constructors - -### new DrawSVGLine() - -> **new DrawSVGLine**(`startElement`, `stopElement`): [`DrawSVGLine`](DrawSVGLine.md) - -Creates a new DrawSVGLine instance. - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `startElement` | `HTMLElement` | The starting element for the line. | -| `stopElement` | `HTMLElement` | The ending element for the line. | - -#### Returns - -[`DrawSVGLine`](DrawSVGLine.md) - -#### Defined in - -[utils/classes/DrawSVGLine.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L21) - -## Properties - -| Property | Type | Defined in | -| ------ | ------ | ------ | -| `line` | `SVGPathElement` | [utils/classes/DrawSVGLine.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L14) | -| `startElement` | `HTMLElement` | [utils/classes/DrawSVGLine.ts:12](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L12) | -| `stopElement` | `HTMLElement` | [utils/classes/DrawSVGLine.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L13) | - -## Methods - -### connect() - -> **connect**(): `void` - -Connects and draws the line. - -#### Returns - -`void` - -#### Defined in - -[utils/classes/DrawSVGLine.ts:66](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L66) - -*** - -### draw() - -> **draw**(`path`): `Promise`\<`void`\> - -Draws the line based on the provided path. - -#### Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `path` | `SVGPathElement` | The SVGPathElement to be used as the base path. | - -#### Returns - -`Promise`\<`void`\> - -#### Throws - -Will throw an error if no path is provided. - -#### Defined in - -[utils/classes/DrawSVGLine.ts:75](https://github.com/phun-ky/speccer/blob/main/src/utils/classes/DrawSVGLine.ts#L75) diff --git a/api/utils/classnames.md b/api/utils/classnames.md new file mode 100644 index 00000000..f7bf77a3 --- /dev/null +++ b/api/utils/classnames.md @@ -0,0 +1,184 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/classnames + +# utils/classnames + +> Last updated 2024-08-14T10:18:52.254Z + +## Functions + +### cx() + +```ts +function cx(cls, cls_obj?): string +``` + +Combines class names and optional properties object into a single string of class names. + +The `cx` function takes two parameters: `cls` and `cls_obj`. +The `cls` parameter can be either a string representing class names or an object with +properties set to `true` or `false`. The `cls_obj` parameter is an optional object with + properties set to `true` or `false`, allowing for conditional inclusion of class names. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `cls` | [`ClassNamesFirstArgType`](../types/interfaces/classnames.md#classnamesfirstargtype) | The class names as a string or an object with properties set to true or false. | +| `cls_obj`? | [`ClassNamesSecondArgType`](../types/interfaces/classnames.md#classnamessecondargtype) | An optional object with properties set to true or false to conditionally include class names. | + +#### Returns + +`string` + +- Returns a single string containing the combined class names. + +#### Example + +```ts +// Generate CSS classes from a string and an object +const classNames = cx('class1', { class2: true, class3: false }); +console.log(classNames); // Example output: 'class1 class2' +``` + +#### Defined in + +[utils/classnames.ts:105](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L105) + +*** + +### remove() + +```ts +function remove( + el, + cls, + avoid?): void +``` + +Remove CSS classes from an HTML element. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el` | `HTMLElement` | `undefined` | The HTML element from which classes should be removed. | +| `cls` | `string` | `undefined` | The CSS classes to remove, separated by spaces. | +| `avoid`? | `string` | `'noop'` | Classes to avoid removing. | + +#### Returns + +`void` + +#### Example + +```ts +// Remove classes from an HTML element +const element = document.getElementById('example'); +remove(element, 'class1 class2'); +``` + +#### Defined in + +[utils/classnames.ts:75](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L75) + +*** + +### set() + +```ts +function set( + el, + cls, + avoid?): void +``` + +Add CSS classes to an HTML element. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el` | `HTMLElement` | `undefined` | The HTML element to which classes should be added. | +| `cls` | `string` | `undefined` | The CSS classes to add, separated by spaces. | +| `avoid`? | `string` | `'noop'` | Classes to avoid adding. | + +#### Returns + +`void` + +#### Example + +```ts +// Add classes to an HTML element +const element = document.getElementById('example'); +set(element, 'class1 class2'); +``` + +#### Defined in + +[utils/classnames.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L23) + +*** + +### toggle() + +```ts +function toggle( + el, + cls, + avoid?): void +``` + +Toggle CSS classes on an HTML element. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el` | `HTMLElement` | `undefined` | The HTML element on which classes should be toggled. | +| `cls` | `string` | `undefined` | The CSS classes to toggle, separated by spaces. | +| `avoid`? | `string` | `'noop'` | Classes to avoid toggling. | + +#### Returns + +`void` + +#### Example + +```ts +// Toggle classes on an HTML element +const element = document.getElementById('example'); +toggle(element, 'class1 class2'); +``` + +#### Defined in + +[utils/classnames.ts:49](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L49) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/classnames/README.md b/api/utils/classnames/README.md deleted file mode 100644 index e29043f9..00000000 --- a/api/utils/classnames/README.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/classnames - -# utils/classnames - -## Index - -### Functions - -- [cx](functions/cx.md) -- [remove](functions/remove.md) -- [set](functions/set.md) -- [toggle](functions/toggle.md) diff --git a/api/utils/classnames/functions/cx.md b/api/utils/classnames/functions/cx.md deleted file mode 100644 index 0302811b..00000000 --- a/api/utils/classnames/functions/cx.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/classnames](../README.md) / cx - -# Function: cx() - -> **cx**(`cls`, `cls_obj`?): `string` - -Combines class names and optional properties object into a single string of class names. - -The `cx` function takes two parameters: `cls` and `cls_obj`. -The `cls` parameter can be either a string representing class names or an object with -properties set to `true` or `false`. The `cls_obj` parameter is an optional object with - properties set to `true` or `false`, allowing for conditional inclusion of class names. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `cls` | [`ClassNamesFirstArgType`](../../../types/interfaces/classnames/type-aliases/ClassNamesFirstArgType.md) | The class names as a string or an object with properties set to true or false. | -| `cls_obj`? | [`ClassNamesSecondArgType`](../../../types/interfaces/classnames/type-aliases/ClassNamesSecondArgType.md) | An optional object with properties set to true or false to conditionally include class names. | - -## Returns - -`string` - -- Returns a single string containing the combined class names. - -## Example - -```ts -// Generate CSS classes from a string and an object -const classNames = cx('class1', { class2: true, class3: false }); -console.log(classNames); // Example output: 'class1 class2' -``` - -## Defined in - -[utils/classnames.ts:105](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L105) diff --git a/api/utils/classnames/functions/remove.md b/api/utils/classnames/functions/remove.md deleted file mode 100644 index ae07adf7..00000000 --- a/api/utils/classnames/functions/remove.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/classnames](../README.md) / remove - -# Function: remove() - -> **remove**(`el`, `cls`, `avoid`?): `void` - -Remove CSS classes from an HTML element. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el` | `HTMLElement` | `undefined` | The HTML element from which classes should be removed. | -| `cls` | `string` | `undefined` | The CSS classes to remove, separated by spaces. | -| `avoid`? | `string` | `'noop'` | Classes to avoid removing. | - -## Returns - -`void` - -## Example - -```ts -// Remove classes from an HTML element -const element = document.getElementById('example'); -remove(element, 'class1 class2'); -``` - -## Defined in - -[utils/classnames.ts:75](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L75) diff --git a/api/utils/classnames/functions/set.md b/api/utils/classnames/functions/set.md deleted file mode 100644 index 8cd3150a..00000000 --- a/api/utils/classnames/functions/set.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/classnames](../README.md) / set - -# Function: set() - -> **set**(`el`, `cls`, `avoid`?): `void` - -Add CSS classes to an HTML element. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el` | `HTMLElement` | `undefined` | The HTML element to which classes should be added. | -| `cls` | `string` | `undefined` | The CSS classes to add, separated by spaces. | -| `avoid`? | `string` | `'noop'` | Classes to avoid adding. | - -## Returns - -`void` - -## Example - -```ts -// Add classes to an HTML element -const element = document.getElementById('example'); -set(element, 'class1 class2'); -``` - -## Defined in - -[utils/classnames.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L23) diff --git a/api/utils/classnames/functions/toggle.md b/api/utils/classnames/functions/toggle.md deleted file mode 100644 index c4e3fef2..00000000 --- a/api/utils/classnames/functions/toggle.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/classnames](../README.md) / toggle - -# Function: toggle() - -> **toggle**(`el`, `cls`, `avoid`?): `void` - -Toggle CSS classes on an HTML element. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el` | `HTMLElement` | `undefined` | The HTML element on which classes should be toggled. | -| `cls` | `string` | `undefined` | The CSS classes to toggle, separated by spaces. | -| `avoid`? | `string` | `'noop'` | Classes to avoid toggling. | - -## Returns - -`void` - -## Example - -```ts -// Toggle classes on an HTML element -const element = document.getElementById('example'); -toggle(element, 'class1 class2'); -``` - -## Defined in - -[utils/classnames.ts:49](https://github.com/phun-ky/speccer/blob/main/src/utils/classnames.ts#L49) diff --git a/api/utils/constants.md b/api/utils/constants.md new file mode 100644 index 00000000..e35e83b8 --- /dev/null +++ b/api/utils/constants.md @@ -0,0 +1,187 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/constants + +# utils/constants + +> Last updated 2024-08-14T10:18:52.254Z + +## Variables + +### SPECCER\_DEFAULT\_LINE\_WIDTH + +```ts +const SPECCER_DEFAULT_LINE_WIDTH: 1 = 1; +``` + +Default line width value. + +#### Example + +```ts +// Access the default line width value +const defaultLineWidth = SPECCER_DEFAULT_LINE_WIDTH; +console.log(defaultLineWidth); // Example output: 1 +``` + +#### Defined in + +[utils/constants.ts:101](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L101) + +*** + +### SPECCER\_DEFAULT\_MEASURE\_SIZE + +```ts +const SPECCER_DEFAULT_MEASURE_SIZE: 8 = 8; +``` + +Default value for measure size. + +#### Example + +```ts +// Access the default measure size value +const defaultMeasureSize = SPECCER_DEFAULT_MEASURE_SIZE; +console.log(defaultMeasureSize); // Example output: 8 +``` + +#### Defined in + +[utils/constants.ts:74](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L74) + +*** + +### SPECCER\_DEFAULT\_MEASURE\_SIZE\_NEG + +```ts +const SPECCER_DEFAULT_MEASURE_SIZE_NEG: number; +``` + +Negative default value for measure size. + +#### Example + +```ts +// Access the negative default measure size value +const negativeDefaultMeasureSize = SPECCER_DEFAULT_MEASURE_SIZE_NEG; +console.log(negativeDefaultMeasureSize); // Example output: -8 +``` + +#### Defined in + +[utils/constants.ts:87](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L87) + +*** + +### SPECCER\_DEFAULT\_PIN\_SPACE + +```ts +const SPECCER_DEFAULT_PIN_SPACE: 48 = 48; +``` + +Default value for pin space. + +#### Example + +```ts +// Access the default pin space value +const defaultPinSpace = SPECCER_DEFAULT_PIN_SPACE; +console.log(defaultPinSpace); // Example output: 48 +``` + +#### Defined in + +[utils/constants.ts:47](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L47) + +*** + +### SPECCER\_DEFAULT\_PIN\_SPACE\_NEG + +```ts +const SPECCER_DEFAULT_PIN_SPACE_NEG: number; +``` + +Negative default value for pin space. + +#### Example + +```ts +// Access the negative default pin space value +const negativeDefaultPinSpace = SPECCER_DEFAULT_PIN_SPACE_NEG; +console.log(negativeDefaultPinSpace); // Example output: -48 +``` + +#### Defined in + +[utils/constants.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L60) + +*** + +### SPECCER\_LITERALS + +```ts +const SPECCER_LITERALS: string[]; +``` + +Array of uppercase letters. + +#### Example + +```ts +// Access the array of uppercase letters +const letters = SPECCER_LITERALS; +console.log(letters); // Example output: ['A', 'B', 'C', ...] +``` + +#### Defined in + +[utils/constants.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L14) + +*** + +### SPECCER\_TAGS\_TO\_AVOID + +```ts +const SPECCER_TAGS_TO_AVOID: string[]; +``` + +Array of HTML tags to avoid when processing. + +#### Example + +```ts +// Access the array of tags to avoid +const tagsToAvoid = SPECCER_TAGS_TO_AVOID; +console.log(tagsToAvoid); // Example output: ['TR', 'TH', 'TD', ...] +``` + +#### Defined in + +[utils/constants.ts:27](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L27) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/constants/README.md b/api/utils/constants/README.md deleted file mode 100644 index b70120c6..00000000 --- a/api/utils/constants/README.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/constants - -# utils/constants - -## Index - -### Variables - -- [SPECCER\_DEFAULT\_LINE\_WIDTH](variables/SPECCER_DEFAULT_LINE_WIDTH.md) -- [SPECCER\_DEFAULT\_MEASURE\_SIZE](variables/SPECCER_DEFAULT_MEASURE_SIZE.md) -- [SPECCER\_DEFAULT\_MEASURE\_SIZE\_NEG](variables/SPECCER_DEFAULT_MEASURE_SIZE_NEG.md) -- [SPECCER\_DEFAULT\_PIN\_SPACE](variables/SPECCER_DEFAULT_PIN_SPACE.md) -- [SPECCER\_DEFAULT\_PIN\_SPACE\_NEG](variables/SPECCER_DEFAULT_PIN_SPACE_NEG.md) -- [SPECCER\_LITERALS](variables/SPECCER_LITERALS.md) -- [SPECCER\_TAGS\_TO\_AVOID](variables/SPECCER_TAGS_TO_AVOID.md) diff --git a/api/utils/constants/variables/SPECCER_DEFAULT_LINE_WIDTH.md b/api/utils/constants/variables/SPECCER_DEFAULT_LINE_WIDTH.md deleted file mode 100644 index 22365280..00000000 --- a/api/utils/constants/variables/SPECCER_DEFAULT_LINE_WIDTH.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_DEFAULT\_LINE\_WIDTH - -# Variable: SPECCER\_DEFAULT\_LINE\_WIDTH - -> `const` **SPECCER\_DEFAULT\_LINE\_WIDTH**: `1` = `1` - -Default line width value. - -## Example - -```ts -// Access the default line width value -const defaultLineWidth = SPECCER_DEFAULT_LINE_WIDTH; -console.log(defaultLineWidth); // Example output: 1 -``` - -## Defined in - -[utils/constants.ts:101](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L101) diff --git a/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE.md b/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE.md deleted file mode 100644 index 218de20a..00000000 --- a/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_DEFAULT\_MEASURE\_SIZE - -# Variable: SPECCER\_DEFAULT\_MEASURE\_SIZE - -> `const` **SPECCER\_DEFAULT\_MEASURE\_SIZE**: `8` = `8` - -Default value for measure size. - -## Example - -```ts -// Access the default measure size value -const defaultMeasureSize = SPECCER_DEFAULT_MEASURE_SIZE; -console.log(defaultMeasureSize); // Example output: 8 -``` - -## Defined in - -[utils/constants.ts:74](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L74) diff --git a/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE_NEG.md b/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE_NEG.md deleted file mode 100644 index e3178e93..00000000 --- a/api/utils/constants/variables/SPECCER_DEFAULT_MEASURE_SIZE_NEG.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_DEFAULT\_MEASURE\_SIZE\_NEG - -# Variable: SPECCER\_DEFAULT\_MEASURE\_SIZE\_NEG - -> `const` **SPECCER\_DEFAULT\_MEASURE\_SIZE\_NEG**: `number` - -Negative default value for measure size. - -## Example - -```ts -// Access the negative default measure size value -const negativeDefaultMeasureSize = SPECCER_DEFAULT_MEASURE_SIZE_NEG; -console.log(negativeDefaultMeasureSize); // Example output: -8 -``` - -## Defined in - -[utils/constants.ts:87](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L87) diff --git a/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE.md b/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE.md deleted file mode 100644 index c77bc958..00000000 --- a/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_DEFAULT\_PIN\_SPACE - -# Variable: SPECCER\_DEFAULT\_PIN\_SPACE - -> `const` **SPECCER\_DEFAULT\_PIN\_SPACE**: `48` = `48` - -Default value for pin space. - -## Example - -```ts -// Access the default pin space value -const defaultPinSpace = SPECCER_DEFAULT_PIN_SPACE; -console.log(defaultPinSpace); // Example output: 48 -``` - -## Defined in - -[utils/constants.ts:47](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L47) diff --git a/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE_NEG.md b/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE_NEG.md deleted file mode 100644 index 94f0bd86..00000000 --- a/api/utils/constants/variables/SPECCER_DEFAULT_PIN_SPACE_NEG.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_DEFAULT\_PIN\_SPACE\_NEG - -# Variable: SPECCER\_DEFAULT\_PIN\_SPACE\_NEG - -> `const` **SPECCER\_DEFAULT\_PIN\_SPACE\_NEG**: `number` - -Negative default value for pin space. - -## Example - -```ts -// Access the negative default pin space value -const negativeDefaultPinSpace = SPECCER_DEFAULT_PIN_SPACE_NEG; -console.log(negativeDefaultPinSpace); // Example output: -48 -``` - -## Defined in - -[utils/constants.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L60) diff --git a/api/utils/constants/variables/SPECCER_LITERALS.md b/api/utils/constants/variables/SPECCER_LITERALS.md deleted file mode 100644 index 4dbda14f..00000000 --- a/api/utils/constants/variables/SPECCER_LITERALS.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_LITERALS - -# Variable: SPECCER\_LITERALS - -> `const` **SPECCER\_LITERALS**: `string`[] - -Array of uppercase letters. - -## Example - -```ts -// Access the array of uppercase letters -const letters = SPECCER_LITERALS; -console.log(letters); // Example output: ['A', 'B', 'C', ...] -``` - -## Defined in - -[utils/constants.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L14) diff --git a/api/utils/constants/variables/SPECCER_TAGS_TO_AVOID.md b/api/utils/constants/variables/SPECCER_TAGS_TO_AVOID.md deleted file mode 100644 index e1f2bbd1..00000000 --- a/api/utils/constants/variables/SPECCER_TAGS_TO_AVOID.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/constants](../README.md) / SPECCER\_TAGS\_TO\_AVOID - -# Variable: SPECCER\_TAGS\_TO\_AVOID - -> `const` **SPECCER\_TAGS\_TO\_AVOID**: `string`[] - -Array of HTML tags to avoid when processing. - -## Example - -```ts -// Access the array of tags to avoid -const tagsToAvoid = SPECCER_TAGS_TO_AVOID; -console.log(tagsToAvoid); // Example output: ['TR', 'TH', 'TD', ...] -``` - -## Defined in - -[utils/constants.ts:27](https://github.com/phun-ky/speccer/blob/main/src/utils/constants.ts#L27) diff --git a/api/utils/coords/variables/coords.md b/api/utils/coords.md similarity index 57% rename from api/utils/coords/variables/coords.md rename to api/utils/coords.md index 7f7af9c4..d98bb940 100644 --- a/api/utils/coords/variables/coords.md +++ b/api/utils/coords.md @@ -1,16 +1,29 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** +SPECCER logo -*** +[@phun-ky/speccer](../README.md) / utils/coords + +# utils/coords -[@phun-ky/speccer](../../../README.md) / [utils/coords](../README.md) / coords +> Last updated 2024-08-14T10:18:52.255Z -# Variable: coords +## Variables -> `const` **coords**: `object` +### coords + +```ts +const coords: { + bottom: (rect) => number; + center_x: (rect) => number; + center_y: (rect) => number; + left: (rect) => number; + right: (rect) => number; + top: (rect) => number; +}; +``` A set of functions to retrieve specific coordinates from a DOMRect. -## Type declaration +#### Type declaration @@ -195,6 +208,32 @@ const topCoordinate = coords.top(rect);
-## Defined in +#### Defined in [utils/coords.ts:4](https://github.com/phun-ky/speccer/blob/main/src/utils/coords.ts#L4) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/coords/README.md b/api/utils/coords/README.md deleted file mode 100644 index a689a186..00000000 --- a/api/utils/coords/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/coords - -# utils/coords - -## Index - -### Variables - -- [coords](variables/coords.md) diff --git a/api/utils/css.md b/api/utils/css.md new file mode 100644 index 00000000..9011dbb7 --- /dev/null +++ b/api/utils/css.md @@ -0,0 +1,312 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/css + +# utils/css + +> Last updated 2024-08-14T10:18:52.255Z + +## Functions + +### getClassNameFromCSSProperty() + +```ts +function getClassNameFromCSSProperty(property): string +``` + +Converts a CSS property name with "Top", "Right", "Bottom", or "Left" into a class name. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `property` | `string` | The CSS property name. | + +#### Returns + +`string` + +- The corresponding class name. + +#### Example + +```ts +// Convert a CSS property name to a class name +const className = getClassNameFromCSSProperty("marginTop"); +console.log(className); // Example output: "margin top" +``` + +#### Defined in + +[utils/css.ts:63](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L63) + +*** + +### getNumberValue() + +```ts +function getNumberValue(value): number +``` + +Parses a string value into an integer. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `value` | `string` | The string value to parse. | + +#### Returns + +`number` + +- The parsed integer value. + +#### Example + +```ts +// Parse a string value into an integer +const intValue = getNumberValue("42"); +console.log(intValue); // Example output: 42 +``` + +#### Defined in + +[utils/css.ts:26](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L26) + +*** + +### getSpacing() + +```ts +function getSpacing(style): SpacingCSSPropertiesType +``` + +Extracts spacing-related CSS properties from a style object. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `style` | [`SpacingCSSPropertiesType`](../types/css.md#spacingcsspropertiestype) | The style object. | + +#### Returns + +[`SpacingCSSPropertiesType`](../types/css.md#spacingcsspropertiestype) + +- The extracted spacing-related properties. + +#### Example + +```ts +// Extract spacing-related properties from a style object +const spacing = getSpacing({ + marginTop: "10px", + marginLeft: "20px", +}); +console.log(spacing); // Example output: { marginTop: "10px", marginLeft: "20px" } +``` + +#### Defined in + +[utils/css.ts:91](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L91) + +*** + +### getTypography() + +```ts +function getTypography(style): TypographyCSSPropertiesType +``` + +Extracts typography-related CSS properties from a style object. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `style` | [`TypographyCSSPropertiesType`](../types/css.md#typographycsspropertiestype) | The style object. | + +#### Returns + +[`TypographyCSSPropertiesType`](../types/css.md#typographycsspropertiestype) + +- The extracted typography-related properties. + +#### Example + +```ts +// Extract typography-related properties from a style object +const typography = getTypography({ + fontSize: "16px", + fontWeight: "bold", +}); +console.log(typography); // Example output: { fontSize: "16px", fontWeight: "bold" } +``` + +#### Defined in + +[utils/css.ts:133](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L133) + +*** + +### lineWidth() + +```ts +function lineWidth(el): number +``` + +Retrieves the value of a custom CSS property "--ph-speccer-line-width" from an element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTML element. | + +#### Returns + +`number` + +- The parsed value of the CSS property or a default value. + +#### Example + +```ts +// Get the value of a custom CSS property from an element +const value = lineWidth(document.body); +console.log(value); // Example output: 1.5 +``` + +#### Defined in + +[utils/css.ts:206](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L206) + +*** + +### measureSize() + +```ts +function measureSize(el): number +``` + +Retrieves the value of a custom CSS property "--ph-speccer-measure-size" from an element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTML element. | + +#### Returns + +`number` + +- The parsed value of the CSS property or a default value. + +#### Example + +```ts +// Get the value of a custom CSS property from an element +const value = measureSize(document.body); +console.log(value); // Example output: 20 +``` + +#### Defined in + +[utils/css.ts:188](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L188) + +*** + +### normalizeNumberValue() + +```ts +function normalizeNumberValue(value): number +``` + +Normalizes a string or number value to ensure it's a valid number. +If the value is within the range [0, 1] or [-1, 0), it's normalized to 0. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `value` | `string` \| `number` | The value to normalize. | + +#### Returns + +`number` + +- The normalized number value. + +#### Example + +```ts +// Normalize a value to ensure it's a valid number +const normalizedValue = normalizeNumberValue("0.5"); +console.log(normalizedValue); // Example output: 0.5 +``` + +#### Defined in + +[utils/css.ts:42](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L42) + +*** + +### pinSpace() + +```ts +function pinSpace(el): number +``` + +Retrieves the value of a custom CSS property "--ph-speccer-pin-space" from an element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTML element. | + +#### Returns + +`number` + +- The parsed value of the CSS property or a default value. + +#### Example + +```ts +// Get the value of a custom CSS property from an element +const value = pinSpace(document.body); +console.log(value); // Example output: 10 +``` + +#### Defined in + +[utils/css.ts:170](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L170) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/css/README.md b/api/utils/css/README.md deleted file mode 100644 index 845a44a7..00000000 --- a/api/utils/css/README.md +++ /dev/null @@ -1,20 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/css - -# utils/css - -## Index - -### Functions - -- [getClassNameFromCSSProperty](functions/getClassNameFromCSSProperty.md) -- [getNumberValue](functions/getNumberValue.md) -- [getSpacing](functions/getSpacing.md) -- [getTypography](functions/getTypography.md) -- [lineWidth](functions/lineWidth.md) -- [measureSize](functions/measureSize.md) -- [normalizeNumberValue](functions/normalizeNumberValue.md) -- [pinSpace](functions/pinSpace.md) diff --git a/api/utils/css/functions/getClassNameFromCSSProperty.md b/api/utils/css/functions/getClassNameFromCSSProperty.md deleted file mode 100644 index 0c5bd0cc..00000000 --- a/api/utils/css/functions/getClassNameFromCSSProperty.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / getClassNameFromCSSProperty - -# Function: getClassNameFromCSSProperty() - -> **getClassNameFromCSSProperty**(`property`): `string` - -Converts a CSS property name with "Top", "Right", "Bottom", or "Left" into a class name. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `property` | `string` | The CSS property name. | - -## Returns - -`string` - -- The corresponding class name. - -## Example - -```ts -// Convert a CSS property name to a class name -const className = getClassNameFromCSSProperty("marginTop"); -console.log(className); // Example output: "margin top" -``` - -## Defined in - -[utils/css.ts:63](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L63) diff --git a/api/utils/css/functions/getNumberValue.md b/api/utils/css/functions/getNumberValue.md deleted file mode 100644 index 920bbaab..00000000 --- a/api/utils/css/functions/getNumberValue.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / getNumberValue - -# Function: getNumberValue() - -> **getNumberValue**(`value`): `number` - -Parses a string value into an integer. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `value` | `string` | The string value to parse. | - -## Returns - -`number` - -- The parsed integer value. - -## Example - -```ts -// Parse a string value into an integer -const intValue = getNumberValue("42"); -console.log(intValue); // Example output: 42 -``` - -## Defined in - -[utils/css.ts:26](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L26) diff --git a/api/utils/css/functions/getSpacing.md b/api/utils/css/functions/getSpacing.md deleted file mode 100644 index c4d77235..00000000 --- a/api/utils/css/functions/getSpacing.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / getSpacing - -# Function: getSpacing() - -> **getSpacing**(`style`): [`SpacingCSSPropertiesType`](../../../types/css/type-aliases/SpacingCSSPropertiesType.md) - -Extracts spacing-related CSS properties from a style object. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `style` | [`SpacingCSSPropertiesType`](../../../types/css/type-aliases/SpacingCSSPropertiesType.md) | The style object. | - -## Returns - -[`SpacingCSSPropertiesType`](../../../types/css/type-aliases/SpacingCSSPropertiesType.md) - -- The extracted spacing-related properties. - -## Example - -```ts -// Extract spacing-related properties from a style object -const spacing = getSpacing({ - marginTop: "10px", - marginLeft: "20px", -}); -console.log(spacing); // Example output: { marginTop: "10px", marginLeft: "20px" } -``` - -## Defined in - -[utils/css.ts:91](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L91) diff --git a/api/utils/css/functions/getTypography.md b/api/utils/css/functions/getTypography.md deleted file mode 100644 index 18a272f9..00000000 --- a/api/utils/css/functions/getTypography.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / getTypography - -# Function: getTypography() - -> **getTypography**(`style`): [`TypographyCSSPropertiesType`](../../../types/css/type-aliases/TypographyCSSPropertiesType.md) - -Extracts typography-related CSS properties from a style object. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `style` | [`TypographyCSSPropertiesType`](../../../types/css/type-aliases/TypographyCSSPropertiesType.md) | The style object. | - -## Returns - -[`TypographyCSSPropertiesType`](../../../types/css/type-aliases/TypographyCSSPropertiesType.md) - -- The extracted typography-related properties. - -## Example - -```ts -// Extract typography-related properties from a style object -const typography = getTypography({ - fontSize: "16px", - fontWeight: "bold", -}); -console.log(typography); // Example output: { fontSize: "16px", fontWeight: "bold" } -``` - -## Defined in - -[utils/css.ts:133](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L133) diff --git a/api/utils/css/functions/lineWidth.md b/api/utils/css/functions/lineWidth.md deleted file mode 100644 index 2d3db91f..00000000 --- a/api/utils/css/functions/lineWidth.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / lineWidth - -# Function: lineWidth() - -> **lineWidth**(`el`): `number` - -Retrieves the value of a custom CSS property "--ph-speccer-line-width" from an element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTML element. | - -## Returns - -`number` - -- The parsed value of the CSS property or a default value. - -## Example - -```ts -// Get the value of a custom CSS property from an element -const value = lineWidth(document.body); -console.log(value); // Example output: 1.5 -``` - -## Defined in - -[utils/css.ts:206](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L206) diff --git a/api/utils/css/functions/measureSize.md b/api/utils/css/functions/measureSize.md deleted file mode 100644 index 76d2d3c4..00000000 --- a/api/utils/css/functions/measureSize.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / measureSize - -# Function: measureSize() - -> **measureSize**(`el`): `number` - -Retrieves the value of a custom CSS property "--ph-speccer-measure-size" from an element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTML element. | - -## Returns - -`number` - -- The parsed value of the CSS property or a default value. - -## Example - -```ts -// Get the value of a custom CSS property from an element -const value = measureSize(document.body); -console.log(value); // Example output: 20 -``` - -## Defined in - -[utils/css.ts:188](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L188) diff --git a/api/utils/css/functions/normalizeNumberValue.md b/api/utils/css/functions/normalizeNumberValue.md deleted file mode 100644 index 06362a95..00000000 --- a/api/utils/css/functions/normalizeNumberValue.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / normalizeNumberValue - -# Function: normalizeNumberValue() - -> **normalizeNumberValue**(`value`): `number` - -Normalizes a string or number value to ensure it's a valid number. -If the value is within the range [0, 1] or [-1, 0), it's normalized to 0. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `value` | `string` \| `number` | The value to normalize. | - -## Returns - -`number` - -- The normalized number value. - -## Example - -```ts -// Normalize a value to ensure it's a valid number -const normalizedValue = normalizeNumberValue("0.5"); -console.log(normalizedValue); // Example output: 0.5 -``` - -## Defined in - -[utils/css.ts:42](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L42) diff --git a/api/utils/css/functions/pinSpace.md b/api/utils/css/functions/pinSpace.md deleted file mode 100644 index ea3dca07..00000000 --- a/api/utils/css/functions/pinSpace.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/css](../README.md) / pinSpace - -# Function: pinSpace() - -> **pinSpace**(`el`): `number` - -Retrieves the value of a custom CSS property "--ph-speccer-pin-space" from an element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTML element. | - -## Returns - -`number` - -- The parsed value of the CSS property or a default value. - -## Example - -```ts -// Get the value of a custom CSS property from an element -const value = pinSpace(document.body); -console.log(value); // Example output: 10 -``` - -## Defined in - -[utils/css.ts:170](https://github.com/phun-ky/speccer/blob/main/src/utils/css.ts#L170) diff --git a/api/utils/debounce.md b/api/utils/debounce.md new file mode 100644 index 00000000..b5bd250d --- /dev/null +++ b/api/utils/debounce.md @@ -0,0 +1,77 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/debounce + +# utils/debounce + +> Last updated 2024-08-14T10:18:52.255Z + +## Functions + +### default() + +```ts +function default( + func, + wait, + immediate?): DebounceAnyFunctionType +``` + +Creates a debounced version of a function that delays its execution until after a specified waiting time has elapsed since the last time the debounced function was invoked. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `func` | [`DebounceAnyFunctionType`](../types/debounce.md#debounceanyfunctiontype) | `undefined` | The function to debounce. | +| `wait` | `number` | `undefined` | The number of milliseconds to wait before invoking the function after the last call. | +| `immediate`? | `boolean` | `false` | If `true`, the function is invoked immediately after the first call. | + +#### Returns + +[`DebounceAnyFunctionType`](../types/debounce.md#debounceanyfunctiontype) + +- The debounced function. + +#### Example + +```ts +// Create a debounced function +const debouncedFn = debounce((value) => { + console.log(value); +}, 500); + +// Call the debounced function +debouncedFn('Hello'); // This will not trigger immediate execution +debouncedFn('World'); // This will trigger immediate execution +``` + +#### Defined in + +[utils/debounce.ts:24](https://github.com/phun-ky/speccer/blob/main/src/utils/debounce.ts#L24) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/debounce/README.md b/api/utils/debounce/README.md deleted file mode 100644 index a7a1c2ca..00000000 --- a/api/utils/debounce/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/debounce - -# utils/debounce - -## Index - -### Functions - -- [default](functions/default.md) diff --git a/api/utils/debounce/functions/default.md b/api/utils/debounce/functions/default.md deleted file mode 100644 index ae192a23..00000000 --- a/api/utils/debounce/functions/default.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/debounce](../README.md) / default - -# Function: default() - -> **default**(`func`, `wait`, `immediate`?): [`DebounceAnyFunctionType`](../../../types/debounce/type-aliases/DebounceAnyFunctionType.md) - -Creates a debounced version of a function that delays its execution until after a specified waiting time has elapsed since the last time the debounced function was invoked. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `func` | [`DebounceAnyFunctionType`](../../../types/debounce/type-aliases/DebounceAnyFunctionType.md) | `undefined` | The function to debounce. | -| `wait` | `number` | `undefined` | The number of milliseconds to wait before invoking the function after the last call. | -| `immediate`? | `boolean` | `false` | If `true`, the function is invoked immediately after the first call. | - -## Returns - -[`DebounceAnyFunctionType`](../../../types/debounce/type-aliases/DebounceAnyFunctionType.md) - -- The debounced function. - -## Example - -```ts -// Create a debounced function -const debouncedFn = debounce((value) => { - console.log(value); -}, 500); - -// Call the debounced function -debouncedFn('Hello'); // This will not trigger immediate execution -debouncedFn('World'); // This will trigger immediate execution -``` - -## Defined in - -[utils/debounce.ts:24](https://github.com/phun-ky/speccer/blob/main/src/utils/debounce.ts#L24) diff --git a/api/utils/direction-of-element.md b/api/utils/direction-of-element.md new file mode 100644 index 00000000..e5fa1dea --- /dev/null +++ b/api/utils/direction-of-element.md @@ -0,0 +1,71 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/direction-of-element + +# utils/direction-of-element + +> Last updated 2024-08-14T10:18:52.255Z + +## Functions + +### direction\_of\_element() + +```ts +function direction_of_element(options): Promise +``` + +Get the direction of an element based on its position relative to another element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `options` | `object` | Options for direction calculation. | +| `options.crude`? | `boolean` | If the direction should be calculated crudely (NSEW). | +| `options.start` | `HTMLElement` | The starting HTML element. | +| `options.stop` | `HTMLElement` | The stopping HTML element. | + +#### Returns + +`Promise`\<`string`\> + +- The calculated direction. + +#### Example + +```ts +// Get the direction of one element relative to another +const startElement = document.getElementById('startElement'); +const stopElement = document.getElementById('stopElement'); +const direction = await direction_of_element({ start: startElement, stop: stopElement }); +``` + +#### Defined in + +[utils/direction-of-element.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/direction-of-element.ts#L21) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/direction-of-element/README.md b/api/utils/direction-of-element/README.md deleted file mode 100644 index aabf1947..00000000 --- a/api/utils/direction-of-element/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/direction-of-element - -# utils/direction-of-element - -## Index - -### Functions - -- [direction\_of\_element](functions/direction_of_element.md) diff --git a/api/utils/direction-of-element/functions/direction_of_element.md b/api/utils/direction-of-element/functions/direction_of_element.md deleted file mode 100644 index e729217b..00000000 --- a/api/utils/direction-of-element/functions/direction_of_element.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/direction-of-element](../README.md) / direction\_of\_element - -# Function: direction\_of\_element() - -> **direction\_of\_element**(`options`): `Promise`\<`string`\> - -Get the direction of an element based on its position relative to another element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `options` | `object` | Options for direction calculation. | -| `options.crude`? | `boolean` | If the direction should be calculated crudely (NSEW). | -| `options.start` | `HTMLElement` | The starting HTML element. | -| `options.stop` | `HTMLElement` | The stopping HTML element. | - -## Returns - -`Promise`\<`string`\> - -- The calculated direction. - -## Example - -```ts -// Get the direction of one element relative to another -const startElement = document.getElementById('startElement'); -const stopElement = document.getElementById('stopElement'); -const direction = await direction_of_element({ start: startElement, stop: stopElement }); -``` - -## Defined in - -[utils/direction-of-element.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/direction-of-element.ts#L21) diff --git a/api/utils/get-coords-pair-from-objects.md b/api/utils/get-coords-pair-from-objects.md new file mode 100644 index 00000000..35ea9d36 --- /dev/null +++ b/api/utils/get-coords-pair-from-objects.md @@ -0,0 +1,96 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/get-coords-pair-from-objects + +# utils/get-coords-pair-from-objects + +> Last updated 2024-08-14T10:18:52.256Z + +## Functions + +### getCoordsPairFromObjects() + +```ts +function getCoordsPairFromObjects( + el1, + el2, + pos1?, + pos2?): Promise<{ + x1: number; + x2: number; + y1: number; + y2: number; +}> +``` + +Get the x and y coordinates of two elements and return them as an object. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el1` | `HTMLElement` | `undefined` | The first HTML element. | +| `el2` | `HTMLElement` | `undefined` | The second HTML element. | +| `pos1`? | `string` | `'center'` | The position to use for the first element. | +| `pos2`? | `string` | `'center'` | The position to use for the second element. | + +#### Returns + +`Promise`\<\{ + `x1`: `number`; + `x2`: `number`; + `y1`: `number`; + `y2`: `number`; + \}\> + +- An object containing the coordinates. + +| Name | Type | Defined in | +| ------ | ------ | ------ | +| `x1` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | +| `x2` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | +| `y1` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | +| `y2` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | + +#### Throws + +No element given. + +#### Example + +```ts +// Get coordinates for two elements +const element1 = document.getElementById('element1'); +const element2 = document.getElementById('element2'); +const coordinates = await get_coords_pair_from_objects(element1, element2); +``` + +#### Defined in + +[utils/get-coords-pair-from-objects.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L20) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/get-coords-pair-from-objects/README.md b/api/utils/get-coords-pair-from-objects/README.md deleted file mode 100644 index 80152fa5..00000000 --- a/api/utils/get-coords-pair-from-objects/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/get-coords-pair-from-objects - -# utils/get-coords-pair-from-objects - -## Index - -### Functions - -- [getCoordsPairFromObjects](functions/getCoordsPairFromObjects.md) diff --git a/api/utils/get-coords-pair-from-objects/functions/getCoordsPairFromObjects.md b/api/utils/get-coords-pair-from-objects/functions/getCoordsPairFromObjects.md deleted file mode 100644 index f4ef4940..00000000 --- a/api/utils/get-coords-pair-from-objects/functions/getCoordsPairFromObjects.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/get-coords-pair-from-objects](../README.md) / getCoordsPairFromObjects - -# Function: getCoordsPairFromObjects() - -> **getCoordsPairFromObjects**(`el1`, `el2`, `pos1`?, `pos2`?): `Promise`\<`object`\> - -Get the x and y coordinates of two elements and return them as an object. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el1` | `HTMLElement` | `undefined` | The first HTML element. | -| `el2` | `HTMLElement` | `undefined` | The second HTML element. | -| `pos1`? | `string` | `'center'` | The position to use for the first element. | -| `pos2`? | `string` | `'center'` | The position to use for the second element. | - -## Returns - -`Promise`\<`object`\> - -- An object containing the coordinates. - -| Name | Type | Defined in | -| ------ | ------ | ------ | -| `x1` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | -| `x2` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | -| `y1` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | -| `y2` | `number` | [utils/get-coords-pair-from-objects.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L25) | - -## Throws - -No element given. - -## Example - -```ts -// Get coordinates for two elements -const element1 = document.getElementById('element1'); -const element2 = document.getElementById('element2'); -const coordinates = await get_coords_pair_from_objects(element1, element2); -``` - -## Defined in - -[utils/get-coords-pair-from-objects.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/get-coords-pair-from-objects.ts#L20) diff --git a/api/utils/id.md b/api/utils/id.md new file mode 100644 index 00000000..eec3d854 --- /dev/null +++ b/api/utils/id.md @@ -0,0 +1,61 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/id + +# utils/id + +> Last updated 2024-08-14T10:18:52.256Z + +## Functions + +### uniqueID() + +```ts +function uniqueID(): string +``` + +Generates a unique ID consisting of an underscore followed by a random alphanumeric string. + +#### Returns + +`string` + +- A unique ID. + +#### Example + +```ts +// Generate a unique ID +const id = uniqueID(); +console.log(id); // Example output: "_abc123def" +``` + +#### Defined in + +[utils/id.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/id.ts#L14) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/id/README.md b/api/utils/id/README.md deleted file mode 100644 index f1336fb1..00000000 --- a/api/utils/id/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/id - -# utils/id - -## Index - -### Functions - -- [uniqueID](functions/uniqueID.md) diff --git a/api/utils/id/functions/uniqueID.md b/api/utils/id/functions/uniqueID.md deleted file mode 100644 index 1fd48dc1..00000000 --- a/api/utils/id/functions/uniqueID.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/id](../README.md) / uniqueID - -# Function: uniqueID() - -> **uniqueID**(): `string` - -Generates a unique ID consisting of an underscore followed by a random alphanumeric string. - -## Returns - -`string` - -- A unique ID. - -## Example - -```ts -// Generate a unique ID -const id = uniqueID(); -console.log(id); // Example output: "_abc123def" -``` - -## Defined in - -[utils/id.ts:14](https://github.com/phun-ky/speccer/blob/main/src/utils/id.ts#L14) diff --git a/api/utils/intrinsic-coords.md b/api/utils/intrinsic-coords.md new file mode 100644 index 00000000..31ef87b9 --- /dev/null +++ b/api/utils/intrinsic-coords.md @@ -0,0 +1,87 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/intrinsic-coords + +# utils/intrinsic-coords + +> Last updated 2024-08-14T10:18:52.256Z + +## Functions + +### intrinsic\_coords() + +```ts +function intrinsic_coords(el, pos?): Promise<{ + x: number; + y: number; +}> +``` + +Get the intrinsic coordinates of an element based on a specified position. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `el` | `HTMLElement` | `undefined` | The HTML element. | +| `pos`? | `string` | `'center'` | The position to use. | + +#### Returns + +`Promise`\<\{ + `x`: `number`; + `y`: `number`; + \}\> + +- An object containing the coordinates. + +| Name | Type | Defined in | +| ------ | ------ | ------ | +| `x` | `number` | [utils/intrinsic-coords.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L23) | +| `y` | `number` | [utils/intrinsic-coords.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L23) | + +#### Throws + +No position given. + +#### Throws + +The position given is not the required type. + +#### Example + +```ts +// Get intrinsic coordinates for an element +const element = document.getElementById('example'); +const coordinates = await intrinsic_coords(element, 'top-left'); +``` + +#### Defined in + +[utils/intrinsic-coords.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L20) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/intrinsic-coords/README.md b/api/utils/intrinsic-coords/README.md deleted file mode 100644 index 5f8bd38e..00000000 --- a/api/utils/intrinsic-coords/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/intrinsic-coords - -# utils/intrinsic-coords - -## Index - -### Functions - -- [intrinsic\_coords](functions/intrinsic_coords.md) diff --git a/api/utils/intrinsic-coords/functions/intrinsic_coords.md b/api/utils/intrinsic-coords/functions/intrinsic_coords.md deleted file mode 100644 index 1c3ef572..00000000 --- a/api/utils/intrinsic-coords/functions/intrinsic_coords.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/intrinsic-coords](../README.md) / intrinsic\_coords - -# Function: intrinsic\_coords() - -> **intrinsic\_coords**(`el`, `pos`?): `Promise`\<`object`\> - -Get the intrinsic coordinates of an element based on a specified position. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `el` | `HTMLElement` | `undefined` | The HTML element. | -| `pos`? | `string` | `'center'` | The position to use. | - -## Returns - -`Promise`\<`object`\> - -- An object containing the coordinates. - -| Name | Type | Defined in | -| ------ | ------ | ------ | -| `x` | `number` | [utils/intrinsic-coords.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L23) | -| `y` | `number` | [utils/intrinsic-coords.ts:23](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L23) | - -## Throws - -No position given. - -## Throws - -The position given is not the required type. - -## Example - -```ts -// Get intrinsic coordinates for an element -const element = document.getElementById('example'); -const coordinates = await intrinsic_coords(element, 'top-left'); -``` - -## Defined in - -[utils/intrinsic-coords.ts:20](https://github.com/phun-ky/speccer/blob/main/src/utils/intrinsic-coords.ts#L20) diff --git a/api/utils/node.md b/api/utils/node.md new file mode 100644 index 00000000..cd776982 --- /dev/null +++ b/api/utils/node.md @@ -0,0 +1,98 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/node + +# utils/node + +> Last updated 2024-08-14T10:18:52.256Z + +## Functions + +### after() + +```ts +function after(el, newSibling): undefined | null | Element +``` + +Inserts an HTML element after another element in the DOM. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `null` \| `HTMLElement` | The reference element after which the new element will be inserted. | +| `newSibling` | `HTMLElement` | The new element to be inserted. | + +#### Returns + +`undefined` \| `null` \| `Element` + +#### Example + +```ts +// Insert an element after another element +const referenceElement = document.getElementById('reference-element'); +const newElement = document.createElement('div'); +after(referenceElement, newElement); + +#### Defined in + +[utils/node.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/node.ts#L15) + +*** + +### removeAll() + +```ts +function removeAll(selector, el): void +``` + +Removes all elements matching a selector from the DOM. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `selector` | `string` | `undefined` | The CSS selector used to select elements for removal. | +| `el` | `Document` | `document` | The document context (default is the global `document` object). | + +#### Returns + +`void` + +#### Example + +```ts +// Remove all elements with a specific class from the document +removeAll('.my-class'); +``` + +#### Defined in + +[utils/node.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/node.ts#L34) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/node/README.md b/api/utils/node/README.md deleted file mode 100644 index 75eabca7..00000000 --- a/api/utils/node/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/node - -# utils/node - -## Index - -### Functions - -- [after](functions/after.md) -- [removeAll](functions/removeAll.md) diff --git a/api/utils/node/functions/after.md b/api/utils/node/functions/after.md deleted file mode 100644 index d29c24f9..00000000 --- a/api/utils/node/functions/after.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/node](../README.md) / after - -# Function: after() - -> **after**(`el`, `newSibling`): `undefined` \| `null` \| `Element` - -Inserts an HTML element after another element in the DOM. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `null` \| `HTMLElement` | The reference element after which the new element will be inserted. | -| `newSibling` | `HTMLElement` | The new element to be inserted. | - -## Returns - -`undefined` \| `null` \| `Element` - -## Example - -```ts -// Insert an element after another element -const referenceElement = document.getElementById('reference-element'); -const newElement = document.createElement('div'); -after(referenceElement, newElement); - -## Defined in - -[utils/node.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/node.ts#L15) diff --git a/api/utils/node/functions/removeAll.md b/api/utils/node/functions/removeAll.md deleted file mode 100644 index a8d542a9..00000000 --- a/api/utils/node/functions/removeAll.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/node](../README.md) / removeAll - -# Function: removeAll() - -> **removeAll**(`selector`, `el`): `void` - -Removes all elements matching a selector from the DOM. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `selector` | `string` | `undefined` | The CSS selector used to select elements for removal. | -| `el` | `Document` | `document` | The document context (default is the global `document` object). | - -## Returns - -`void` - -## Example - -```ts -// Remove all elements with a specific class from the document -removeAll('.my-class'); -``` - -## Defined in - -[utils/node.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/node.ts#L34) diff --git a/api/utils/number.md b/api/utils/number.md new file mode 100644 index 00000000..433215de --- /dev/null +++ b/api/utils/number.md @@ -0,0 +1,67 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/number + +# utils/number + +> Last updated 2024-08-14T10:18:52.256Z + +## Functions + +### decimal() + +```ts +function decimal(number, decimals): string +``` + +Converts a number to a string with a specified number of decimal places. + +#### Parameters + +| Parameter | Type | Default value | Description | +| ------ | ------ | ------ | ------ | +| `number` | `string` \| `number` | `undefined` | The number to convert. | +| `decimals` | `number` | `3` | The number of decimal places (default is 3). | + +#### Returns + +`string` + +- The formatted number as a string. + +#### Example + +```ts +// Convert a number to a string with 2 decimal places +const formattedNumber = decimal(12.3456, 2); // "12.34" +``` + +#### Defined in + +[utils/number.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/number.ts#L15) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/number/README.md b/api/utils/number/README.md deleted file mode 100644 index d0c9ef3e..00000000 --- a/api/utils/number/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/number - -# utils/number - -## Index - -### Functions - -- [decimal](functions/decimal.md) diff --git a/api/utils/number/functions/decimal.md b/api/utils/number/functions/decimal.md deleted file mode 100644 index 9de31a91..00000000 --- a/api/utils/number/functions/decimal.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/number](../README.md) / decimal - -# Function: decimal() - -> **decimal**(`number`, `decimals`): `string` - -Converts a number to a string with a specified number of decimal places. - -## Parameters - -| Parameter | Type | Default value | Description | -| ------ | ------ | ------ | ------ | -| `number` | `string` \| `number` | `undefined` | The number to convert. | -| `decimals` | `number` | `3` | The number of decimal places (default is 3). | - -## Returns - -`string` - -- The formatted number as a string. - -## Example - -```ts -// Convert a number to a string with 2 decimal places -const formattedNumber = decimal(12.3456, 2); // "12.34" -``` - -## Defined in - -[utils/number.ts:15](https://github.com/phun-ky/speccer/blob/main/src/utils/number.ts#L15) diff --git a/api/utils/position.md b/api/utils/position.md new file mode 100644 index 00000000..b2fd3076 --- /dev/null +++ b/api/utils/position.md @@ -0,0 +1,216 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/position + +# utils/position + +> Last updated 2024-08-14T10:18:52.257Z + +## Functions + +### getRec() + +```ts +function getRec(sourceEl, targetEl): Promise +``` + +Gets various positioning properties between two HTML elements. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `sourceEl` | `HTMLElement` | The source HTML element. | +| `targetEl` | `HTMLElement` | The target HTML element. | + +#### Returns + +`Promise`\<[`GetRecPropertiesInterface`](../types/interfaces/position.md#getrecpropertiesinterface)\> + +- A promise that resolves to an object with positioning functions. + +#### Example + +```ts +// Get positioning properties between two elements +const recProps = await getRec(sourceElement, targetElement); + +// Get the absolute position properties +const absoluteProps = recProps.absolute(); + +// Get the position properties with the source element above the target element +const aboveProps = recProps.toTop(); +``` + +#### Defined in + +[utils/position.ts:159](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L159) + +*** + +### get\_horizontal\_center\_of\_els() + +```ts +function get_horizontal_center_of_els( + modifier, + startRect, + targetRect): number +``` + +Calculates the horizontal center of two elements. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `modifier` | `number` | A modifier value. | +| `startRect` | `DOMRect` | The starting element's rectangle. | +| `targetRect` | `DOMRect` | The target element's rectangle. | + +#### Returns + +`number` + +- The horizontal center position. + +#### Example + +```ts +// Calculate the horizontal center of two elements +const center = get_horizontal_center_of_els(0, startRect, targetRect); +``` + +#### Defined in + +[utils/position.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L21) + +*** + +### get\_vertical\_center\_of\_els() + +```ts +function get_vertical_center_of_els( + modifier, + startRect, + targetRect): number +``` + +Calculates the vertical center of two elements. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `modifier` | `number` | A modifier value. | +| `startRect` | `DOMRect` | The starting element's rectangle. | +| `targetRect` | `DOMRect` | The target element's rectangle. | + +#### Returns + +`number` + +- The vertical center position. + +#### Example + +```ts +// Calculate the vertical center of two elements +const center = get_vertical_center_of_els(0, startRect, targetRect); +``` + +#### Defined in + +[utils/position.ts:41](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L41) + +*** + +### offset() + +```ts +function offset(targetEl): Promise +``` + +Gets the offset properties of an HTML element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `targetEl` | `HTMLElement` | The target HTML element. | + +#### Returns + +`Promise`\<[`PositionPropertiesType`](../types/position.md#positionpropertiestype)\> + +- A promise that resolves to the offset properties. + +#### Example + +```ts +// Get the offset properties of an element +const offsetProps = await offset(targetElement); +``` + +#### Defined in + +[utils/position.ts:59](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L59) + +*** + +### offsetWithCenter() + +```ts +function offsetWithCenter(sourceEl, targetEl): Promise +``` + +Gets the offset properties of an HTML element with its center aligned to another element. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `sourceEl` | `HTMLElement` | The source HTML element. | +| `targetEl` | `HTMLElement` | The target HTML element. | + +#### Returns + +`Promise`\<[`PositionPropertiesType`](../types/position.md#positionpropertiestype)\> + +- A promise that resolves to the offset properties. + +#### Example + +```ts +// Get the offset properties of an element with its center aligned to another element +const offsetProps = await offsetWithCenter(sourceElement, targetElement); +``` + +#### Defined in + +[utils/position.ts:117](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L117) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/position/README.md b/api/utils/position/README.md deleted file mode 100644 index 4c815673..00000000 --- a/api/utils/position/README.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/position - -# utils/position - -## Index - -### Functions - -- [getRec](functions/getRec.md) -- [get\_horizontal\_center\_of\_els](functions/get_horizontal_center_of_els.md) -- [get\_vertical\_center\_of\_els](functions/get_vertical_center_of_els.md) -- [offset](functions/offset.md) -- [offsetWithCenter](functions/offsetWithCenter.md) diff --git a/api/utils/position/functions/getRec.md b/api/utils/position/functions/getRec.md deleted file mode 100644 index 43508547..00000000 --- a/api/utils/position/functions/getRec.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/position](../README.md) / getRec - -# Function: getRec() - -> **getRec**(`sourceEl`, `targetEl`): `Promise`\<[`GetRecPropertiesInterface`](../../../types/interfaces/position/interfaces/GetRecPropertiesInterface.md)\> - -Gets various positioning properties between two HTML elements. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `sourceEl` | `HTMLElement` | The source HTML element. | -| `targetEl` | `HTMLElement` | The target HTML element. | - -## Returns - -`Promise`\<[`GetRecPropertiesInterface`](../../../types/interfaces/position/interfaces/GetRecPropertiesInterface.md)\> - -- A promise that resolves to an object with positioning functions. - -## Example - -```ts -// Get positioning properties between two elements -const recProps = await getRec(sourceElement, targetElement); - -// Get the absolute position properties -const absoluteProps = recProps.absolute(); - -// Get the position properties with the source element above the target element -const aboveProps = recProps.toTop(); -``` - -## Defined in - -[utils/position.ts:159](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L159) diff --git a/api/utils/position/functions/get_horizontal_center_of_els.md b/api/utils/position/functions/get_horizontal_center_of_els.md deleted file mode 100644 index 4f2922c2..00000000 --- a/api/utils/position/functions/get_horizontal_center_of_els.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/position](../README.md) / get\_horizontal\_center\_of\_els - -# Function: get\_horizontal\_center\_of\_els() - -> **get\_horizontal\_center\_of\_els**(`modifier`, `startRect`, `targetRect`): `number` - -Calculates the horizontal center of two elements. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `modifier` | `number` | A modifier value. | -| `startRect` | `DOMRect` | The starting element's rectangle. | -| `targetRect` | `DOMRect` | The target element's rectangle. | - -## Returns - -`number` - -- The horizontal center position. - -## Example - -```ts -// Calculate the horizontal center of two elements -const center = get_horizontal_center_of_els(0, startRect, targetRect); -``` - -## Defined in - -[utils/position.ts:21](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L21) diff --git a/api/utils/position/functions/get_vertical_center_of_els.md b/api/utils/position/functions/get_vertical_center_of_els.md deleted file mode 100644 index fef42992..00000000 --- a/api/utils/position/functions/get_vertical_center_of_els.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/position](../README.md) / get\_vertical\_center\_of\_els - -# Function: get\_vertical\_center\_of\_els() - -> **get\_vertical\_center\_of\_els**(`modifier`, `startRect`, `targetRect`): `number` - -Calculates the vertical center of two elements. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `modifier` | `number` | A modifier value. | -| `startRect` | `DOMRect` | The starting element's rectangle. | -| `targetRect` | `DOMRect` | The target element's rectangle. | - -## Returns - -`number` - -- The vertical center position. - -## Example - -```ts -// Calculate the vertical center of two elements -const center = get_vertical_center_of_els(0, startRect, targetRect); -``` - -## Defined in - -[utils/position.ts:41](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L41) diff --git a/api/utils/position/functions/offset.md b/api/utils/position/functions/offset.md deleted file mode 100644 index 14b2403b..00000000 --- a/api/utils/position/functions/offset.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/position](../README.md) / offset - -# Function: offset() - -> **offset**(`targetEl`): `Promise`\<[`PositionPropertiesType`](../../../types/position/type-aliases/PositionPropertiesType.md)\> - -Gets the offset properties of an HTML element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `targetEl` | `HTMLElement` | The target HTML element. | - -## Returns - -`Promise`\<[`PositionPropertiesType`](../../../types/position/type-aliases/PositionPropertiesType.md)\> - -- A promise that resolves to the offset properties. - -## Example - -```ts -// Get the offset properties of an element -const offsetProps = await offset(targetElement); -``` - -## Defined in - -[utils/position.ts:59](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L59) diff --git a/api/utils/position/functions/offsetWithCenter.md b/api/utils/position/functions/offsetWithCenter.md deleted file mode 100644 index 4ca257e0..00000000 --- a/api/utils/position/functions/offsetWithCenter.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/position](../README.md) / offsetWithCenter - -# Function: offsetWithCenter() - -> **offsetWithCenter**(`sourceEl`, `targetEl`): `Promise`\<[`PositionPropertiesType`](../../../types/position/type-aliases/PositionPropertiesType.md)\> - -Gets the offset properties of an HTML element with its center aligned to another element. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `sourceEl` | `HTMLElement` | The source HTML element. | -| `targetEl` | `HTMLElement` | The target HTML element. | - -## Returns - -`Promise`\<[`PositionPropertiesType`](../../../types/position/type-aliases/PositionPropertiesType.md)\> - -- A promise that resolves to the offset properties. - -## Example - -```ts -// Get the offset properties of an element with its center aligned to another element -const offsetProps = await offsetWithCenter(sourceElement, targetElement); -``` - -## Defined in - -[utils/position.ts:117](https://github.com/phun-ky/speccer/blob/main/src/utils/position.ts#L117) diff --git a/api/utils/resize.md b/api/utils/resize.md new file mode 100644 index 00000000..be9bceb7 --- /dev/null +++ b/api/utils/resize.md @@ -0,0 +1,70 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/resize + +# utils/resize + +> Last updated 2024-08-14T10:18:52.257Z + +## Functions + +### activate() + +```ts +function activate(speccer): void +``` + +Attaches a debounced event listener to the window's resize event that triggers the provided function. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `speccer` | [`SpeccerFunctionType`](../types/speccer.md#speccerfunctiontype) | The function to trigger when the window is resized. | + +#### Returns + +`void` + +#### Example + +```ts +// Define a function to be triggered on window resize +const mySpeccer = () => { + // Your logic here + console.log('Window resized'); +}; + +// Activate the debounced event listener +activate(mySpeccer); +``` + +#### Defined in + +[utils/resize.ts:22](https://github.com/phun-ky/speccer/blob/main/src/utils/resize.ts#L22) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/resize/README.md b/api/utils/resize/README.md deleted file mode 100644 index ac25e015..00000000 --- a/api/utils/resize/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/resize - -# utils/resize - -## Index - -### Functions - -- [activate](functions/activate.md) diff --git a/api/utils/resize/functions/activate.md b/api/utils/resize/functions/activate.md deleted file mode 100644 index 95c623d7..00000000 --- a/api/utils/resize/functions/activate.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/resize](../README.md) / activate - -# Function: activate() - -> **activate**(`speccer`): `void` - -Attaches a debounced event listener to the window's resize event that triggers the provided function. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `speccer` | [`SpeccerFunctionType`](../../../types/speccer/type-aliases/SpeccerFunctionType.md) | The function to trigger when the window is resized. | - -## Returns - -`void` - -## Example - -```ts -// Define a function to be triggered on window resize -const mySpeccer = () => { - // Your logic here - console.log('Window resized'); -}; - -// Activate the debounced event listener -activate(mySpeccer); -``` - -## Defined in - -[utils/resize.ts:22](https://github.com/phun-ky/speccer/blob/main/src/utils/resize.ts#L22) diff --git a/api/utils/style-property.md b/api/utils/style-property.md new file mode 100644 index 00000000..11636717 --- /dev/null +++ b/api/utils/style-property.md @@ -0,0 +1,67 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/style-property + +# utils/style-property + +> Last updated 2024-08-14T10:18:52.257Z + +## Functions + +### isSticky() + +```ts +function isSticky(element): Promise +``` + +Checks if an element has 'position: sticky'. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `element` | `HTMLElement` | The target element. | + +#### Returns + +`Promise`\<`boolean`\> + +- A promise that resolves to true if the element has 'position: sticky', false otherwise. + +#### Example + +```ts +// Usage example: +const isElementSticky = await isSticky(myElement); +console.log(isElementSticky); // true or false +``` + +#### Defined in + +[utils/style-property.ts:96](https://github.com/phun-ky/speccer/blob/main/src/utils/style-property.ts#L96) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/style-property/README.md b/api/utils/style-property/README.md deleted file mode 100644 index 09379590..00000000 --- a/api/utils/style-property/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/style-property - -# utils/style-property - -## Index - -### Functions - -- [isSticky](functions/isSticky.md) diff --git a/api/utils/style-property/functions/isSticky.md b/api/utils/style-property/functions/isSticky.md deleted file mode 100644 index 1f009467..00000000 --- a/api/utils/style-property/functions/isSticky.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/style-property](../README.md) / isSticky - -# Function: isSticky() - -> **isSticky**(`element`): `Promise`\<`boolean`\> - -Checks if an element has 'position: sticky'. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `element` | `HTMLElement` | The target element. | - -## Returns - -`Promise`\<`boolean`\> - -- A promise that resolves to true if the element has 'position: sticky', false otherwise. - -## Example - -```ts -// Usage example: -const isElementSticky = await isSticky(myElement); -console.log(isElementSticky); // true or false -``` - -## Defined in - -[utils/style-property.ts:96](https://github.com/phun-ky/speccer/blob/main/src/utils/style-property.ts#L96) diff --git a/api/utils/styles.md b/api/utils/styles.md new file mode 100644 index 00000000..ca42dd61 --- /dev/null +++ b/api/utils/styles.md @@ -0,0 +1,110 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/styles + +# utils/styles + +> Last updated 2024-08-14T10:18:52.257Z + +## Functions + +### add() + +```ts +function add(el, styles): Promise +``` + +Adds CSS styles to an HTMLElement. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTMLElement to apply styles to. | +| `styles` | `object` \| \{ `key`: `string`; `value`: `string`; \}[] | An object or an array of objects containing CSS styles to apply. | + +#### Returns + +`Promise`\<`void`\> + +- A Promise that resolves after styles are applied. + +#### Example + +```ts +// Apply styles as an object +const element = document.getElementById('my-element'); +await add(element, { color: 'red', fontSize: '16px' }); + +// Apply styles as an array of objects +const styles = [ + { key: 'color', value: 'blue' }, + { key: 'backgroundColor', value: 'yellow' } +]; +await add(element, styles); +``` + +#### Defined in + +[utils/styles.ts:26](https://github.com/phun-ky/speccer/blob/main/src/utils/styles.ts#L26) + +*** + +### get() + +```ts +function get(el): Promise +``` + +Gets the computed CSS styles of an HTMLElement. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `el` | `HTMLElement` | The HTMLElement to get computed styles from. | + +#### Returns + +`Promise`\<`CSSStyleDeclaration`\> + +- A Promise that resolves with the computed CSS styles. + +#### Example + +```ts +// Get computed styles of an element +const element = document.getElementById('my-element'); +const computedStyles = await get(element); +console.log(computedStyles.color); // Logs the color property value +``` + +#### Defined in + +[utils/styles.ts:67](https://github.com/phun-ky/speccer/blob/main/src/utils/styles.ts#L67) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/styles/README.md b/api/utils/styles/README.md deleted file mode 100644 index d147e1aa..00000000 --- a/api/utils/styles/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/styles - -# utils/styles - -## Index - -### Functions - -- [add](functions/add.md) -- [get](functions/get.md) diff --git a/api/utils/styles/functions/add.md b/api/utils/styles/functions/add.md deleted file mode 100644 index f495e02f..00000000 --- a/api/utils/styles/functions/add.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/styles](../README.md) / add - -# Function: add() - -> **add**(`el`, `styles`): `Promise`\<`void`\> - -Adds CSS styles to an HTMLElement. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTMLElement to apply styles to. | -| `styles` | `object` \| `object`[] | An object or an array of objects containing CSS styles to apply. | - -## Returns - -`Promise`\<`void`\> - -- A Promise that resolves after styles are applied. - -## Example - -```ts -// Apply styles as an object -const element = document.getElementById('my-element'); -await add(element, { color: 'red', fontSize: '16px' }); - -// Apply styles as an array of objects -const styles = [ - { key: 'color', value: 'blue' }, - { key: 'backgroundColor', value: 'yellow' } -]; -await add(element, styles); -``` - -## Defined in - -[utils/styles.ts:26](https://github.com/phun-ky/speccer/blob/main/src/utils/styles.ts#L26) diff --git a/api/utils/styles/functions/get.md b/api/utils/styles/functions/get.md deleted file mode 100644 index 57ed738b..00000000 --- a/api/utils/styles/functions/get.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/styles](../README.md) / get - -# Function: get() - -> **get**(`el`): `Promise`\<`CSSStyleDeclaration`\> - -Gets the computed CSS styles of an HTMLElement. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `el` | `HTMLElement` | The HTMLElement to get computed styles from. | - -## Returns - -`Promise`\<`CSSStyleDeclaration`\> - -- A Promise that resolves with the computed CSS styles. - -## Example - -```ts -// Get computed styles of an element -const element = document.getElementById('my-element'); -const computedStyles = await get(element); -console.log(computedStyles.color); // Logs the color property value -``` - -## Defined in - -[utils/styles.ts:67](https://github.com/phun-ky/speccer/blob/main/src/utils/styles.ts#L67) diff --git a/api/utils/typeof.md b/api/utils/typeof.md new file mode 100644 index 00000000..2d9cad79 --- /dev/null +++ b/api/utils/typeof.md @@ -0,0 +1,241 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/typeof + +# utils/typeof + +> Last updated 2024-08-14T10:18:52.257Z + +## Functions + +### isBoolean() + +```ts +function isBoolean(variable): boolean +``` + +Checks if the given variable is a boolean. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is a boolean, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:42](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L42) + +*** + +### isNotBoolean() + +```ts +function isNotBoolean(variable): boolean +``` + +Checks if the given variable is not a boolean. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is not a boolean, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:51](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L51) + +*** + +### isNotNumber() + +```ts +function isNotNumber(variable): boolean +``` + +Checks if the given variable is not a number. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is not a number, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L34) + +*** + +### isNotString() + +```ts +function isNotString(variable): boolean +``` + +Checks if the given variable is not a string. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is not a string, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:17](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L17) + +*** + +### isNotUndefined() + +```ts +function isNotUndefined(variable): boolean +``` + +Checks if the given variable is not undefined. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is not undefined, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:69](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L69) + +*** + +### isNumber() + +```ts +function isNumber(variable): boolean +``` + +Checks if the given variable is a number. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is a number, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L25) + +*** + +### isString() + +```ts +function isString(variable): boolean +``` + +Checks if the given variable is a string. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is a string, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:8](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L8) + +*** + +### isUndefined() + +```ts +function isUndefined(variable): boolean +``` + +Checks if the given variable is undefined. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `variable` | `unknown` | The variable to check. | + +#### Returns + +`boolean` + +True if the variable is undefined, false otherwise. + +#### Defined in + +[utils/typeof/index.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L60) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/typeof/README.md b/api/utils/typeof/README.md deleted file mode 100644 index d3dbb251..00000000 --- a/api/utils/typeof/README.md +++ /dev/null @@ -1,20 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/typeof - -# utils/typeof - -## Index - -### Functions - -- [isBoolean](functions/isBoolean.md) -- [isNotBoolean](functions/isNotBoolean.md) -- [isNotNumber](functions/isNotNumber.md) -- [isNotString](functions/isNotString.md) -- [isNotUndefined](functions/isNotUndefined.md) -- [isNumber](functions/isNumber.md) -- [isString](functions/isString.md) -- [isUndefined](functions/isUndefined.md) diff --git a/api/utils/typeof/functions/isBoolean.md b/api/utils/typeof/functions/isBoolean.md deleted file mode 100644 index 7f3f6816..00000000 --- a/api/utils/typeof/functions/isBoolean.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isBoolean - -# Function: isBoolean() - -> **isBoolean**(`variable`): `boolean` - -Checks if the given variable is a boolean. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is a boolean, false otherwise. - -## Defined in - -[utils/typeof/index.ts:42](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L42) diff --git a/api/utils/typeof/functions/isNotBoolean.md b/api/utils/typeof/functions/isNotBoolean.md deleted file mode 100644 index 3c851c26..00000000 --- a/api/utils/typeof/functions/isNotBoolean.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isNotBoolean - -# Function: isNotBoolean() - -> **isNotBoolean**(`variable`): `boolean` - -Checks if the given variable is not a boolean. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is not a boolean, false otherwise. - -## Defined in - -[utils/typeof/index.ts:51](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L51) diff --git a/api/utils/typeof/functions/isNotNumber.md b/api/utils/typeof/functions/isNotNumber.md deleted file mode 100644 index b3220aec..00000000 --- a/api/utils/typeof/functions/isNotNumber.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isNotNumber - -# Function: isNotNumber() - -> **isNotNumber**(`variable`): `boolean` - -Checks if the given variable is not a number. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is not a number, false otherwise. - -## Defined in - -[utils/typeof/index.ts:34](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L34) diff --git a/api/utils/typeof/functions/isNotString.md b/api/utils/typeof/functions/isNotString.md deleted file mode 100644 index e685e6d5..00000000 --- a/api/utils/typeof/functions/isNotString.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isNotString - -# Function: isNotString() - -> **isNotString**(`variable`): `boolean` - -Checks if the given variable is not a string. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is not a string, false otherwise. - -## Defined in - -[utils/typeof/index.ts:17](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L17) diff --git a/api/utils/typeof/functions/isNotUndefined.md b/api/utils/typeof/functions/isNotUndefined.md deleted file mode 100644 index 5ea96154..00000000 --- a/api/utils/typeof/functions/isNotUndefined.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isNotUndefined - -# Function: isNotUndefined() - -> **isNotUndefined**(`variable`): `boolean` - -Checks if the given variable is not undefined. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is not undefined, false otherwise. - -## Defined in - -[utils/typeof/index.ts:69](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L69) diff --git a/api/utils/typeof/functions/isNumber.md b/api/utils/typeof/functions/isNumber.md deleted file mode 100644 index a3b294ad..00000000 --- a/api/utils/typeof/functions/isNumber.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isNumber - -# Function: isNumber() - -> **isNumber**(`variable`): `boolean` - -Checks if the given variable is a number. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is a number, false otherwise. - -## Defined in - -[utils/typeof/index.ts:25](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L25) diff --git a/api/utils/typeof/functions/isString.md b/api/utils/typeof/functions/isString.md deleted file mode 100644 index 02e8bf2e..00000000 --- a/api/utils/typeof/functions/isString.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isString - -# Function: isString() - -> **isString**(`variable`): `boolean` - -Checks if the given variable is a string. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is a string, false otherwise. - -## Defined in - -[utils/typeof/index.ts:8](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L8) diff --git a/api/utils/typeof/functions/isUndefined.md b/api/utils/typeof/functions/isUndefined.md deleted file mode 100644 index 3db4f041..00000000 --- a/api/utils/typeof/functions/isUndefined.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/typeof](../README.md) / isUndefined - -# Function: isUndefined() - -> **isUndefined**(`variable`): `boolean` - -Checks if the given variable is undefined. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `variable` | `unknown` | The variable to check. | - -## Returns - -`boolean` - -True if the variable is undefined, false otherwise. - -## Defined in - -[utils/typeof/index.ts:60](https://github.com/phun-ky/speccer/blob/main/src/utils/typeof/index.ts#L60) diff --git a/api/utils/wait.md b/api/utils/wait.md new file mode 100644 index 00000000..6e844d81 --- /dev/null +++ b/api/utils/wait.md @@ -0,0 +1,96 @@ +SPECCER logo + +[@phun-ky/speccer](../README.md) / utils/wait + +# utils/wait + +> Last updated 2024-08-14T10:18:52.259Z + +## Functions + +### waitFor() + +```ts +function waitFor(ms): Promise +``` + +Waits for the specified amount of time in milliseconds. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `ms` | `number` | The number of milliseconds to wait. | + +#### Returns + +`Promise`\<`void`\> + +- A Promise that resolves after the specified time. + +#### Example + +```ts +// Wait for 1 second (1000 milliseconds) +await waitFor(1000); +``` + +#### Defined in + +[utils/wait.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/wait.ts#L13) + +*** + +### waitForFrame() + +```ts +function waitForFrame(): Promise +``` + +Waits for the next animation frame using requestAnimationFrame. + +#### Returns + +`Promise`\<`number`\> + +- A Promise that resolves with the timestamp of the next animation frame. + +#### Example + +```ts +// Wait for the next animation frame and get the rect +await waitForFrame(); +const rect = el.getBoundingClientRect(); +// Wait for the next animation frame and get the timestamp +const timestamp = await waitForFrame(); +``` + +#### Defined in + +[utils/wait.ts:30](https://github.com/phun-ky/speccer/blob/main/src/utils/wait.ts#L30) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/wait/README.md b/api/utils/wait/README.md deleted file mode 100644 index e23ccf41..00000000 --- a/api/utils/wait/README.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/wait - -# utils/wait - -## Index - -### Functions - -- [waitFor](functions/waitFor.md) -- [waitForFrame](functions/waitForFrame.md) diff --git a/api/utils/wait/functions/waitFor.md b/api/utils/wait/functions/waitFor.md deleted file mode 100644 index 1bc252e8..00000000 --- a/api/utils/wait/functions/waitFor.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/wait](../README.md) / waitFor - -# Function: waitFor() - -> **waitFor**(`ms`): `Promise`\<`void`\> - -Waits for the specified amount of time in milliseconds. - -## Parameters - -| Parameter | Type | Description | -| ------ | ------ | ------ | -| `ms` | `number` | The number of milliseconds to wait. | - -## Returns - -`Promise`\<`void`\> - -- A Promise that resolves after the specified time. - -## Example - -```ts -// Wait for 1 second (1000 milliseconds) -await waitFor(1000); -``` - -## Defined in - -[utils/wait.ts:13](https://github.com/phun-ky/speccer/blob/main/src/utils/wait.ts#L13) diff --git a/api/utils/wait/functions/waitForFrame.md b/api/utils/wait/functions/waitForFrame.md deleted file mode 100644 index 6f078bb1..00000000 --- a/api/utils/wait/functions/waitForFrame.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../../README.md) / [utils/wait](../README.md) / waitForFrame - -# Function: waitForFrame() - -> **waitForFrame**(): `Promise`\<`number`\> - -Waits for the next animation frame using requestAnimationFrame. - -## Returns - -`Promise`\<`number`\> - -- A Promise that resolves with the timestamp of the next animation frame. - -## Example - -```ts -// Wait for the next animation frame and get the rect -await waitForFrame(); -const rect = el.getBoundingClientRect(); -// Wait for the next animation frame and get the timestamp -const timestamp = await waitForFrame(); -``` - -## Defined in - -[utils/wait.ts:30](https://github.com/phun-ky/speccer/blob/main/src/utils/wait.ts#L30) diff --git a/api/utils/xy/variables/xy.md b/api/utils/xy.md similarity index 64% rename from api/utils/xy/variables/xy.md rename to api/utils/xy.md index 9b56ce35..b42491bf 100644 --- a/api/utils/xy/variables/xy.md +++ b/api/utils/xy.md @@ -1,16 +1,43 @@ -[**@phun-ky/speccer**](../../../README.md) • **Docs** +SPECCER logo -*** +[@phun-ky/speccer](../README.md) / utils/xy + +# utils/xy -[@phun-ky/speccer](../../../README.md) / [utils/xy](../README.md) / xy +> Last updated 2024-08-14T10:18:52.259Z -# Variable: xy +## Variables -> `const` **xy**: `object` +### xy + +```ts +const xy: { + bottom: (rect) => SpeccerCoordinatesInterface; + bottom-center: (rect) => SpeccerCoordinatesInterface; + bottom-left: (rect) => SpeccerCoordinatesInterface; + bottom-right: (rect) => SpeccerCoordinatesInterface; + center: (rect) => SpeccerCoordinatesInterface; + left: (rect) => SpeccerCoordinatesInterface; + left-bottom: (rect) => SpeccerCoordinatesInterface; + left-center: (rect) => SpeccerCoordinatesInterface; + left-top: (rect) => SpeccerCoordinatesInterface; + right: (rect) => SpeccerCoordinatesInterface; + right-bottom: (rect) => SpeccerCoordinatesInterface; + right-center: (rect) => SpeccerCoordinatesInterface; + right-top: (rect) => { + x: number; + y: number; + }; + top: (rect) => SpeccerCoordinatesInterface; + top-center: (rect) => SpeccerCoordinatesInterface; + top-left: (rect) => SpeccerCoordinatesInterface; + top-right: (rect) => SpeccerCoordinatesInterface; +}; +``` Object containing functions to retrieve specific x and y coordinates from a DOMRect. -## Type declaration +#### Type declaration @@ -27,7 +54,7 @@ Object containing functions to retrieve specific x and y coordinates from a DOMR
-(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -57,7 +84,7 @@ const bottomCenterCoordinates = xy.bottom(rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -87,7 +114,7 @@ const bottomCenterCoordinates = xy['bottom-center'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -117,7 +144,7 @@ const bottomLeftCoordinates = xy['bottom-left'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -147,7 +174,7 @@ const bottomRight = xy['bottom-right'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -177,7 +204,7 @@ const centerCoordinates = xy.center(rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -207,7 +234,7 @@ const leftCoordinates = xy.left(rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -237,7 +264,7 @@ const leftBottomCoordinates = xy['left-bottom'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -267,7 +294,7 @@ const leftCenterCoordinates = xy['left-center'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -297,7 +324,7 @@ const leftTop = xy['left-top'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -327,7 +354,7 @@ const rightCenterCoordinates = xy.right(rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -357,7 +384,7 @@ const rightBottomCoordinates = xy['right-bottom'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -387,7 +414,10 @@ const rightCenterCoordinates = xy['right-center'](rect); -(`rect`) => `object` +(`rect`) => \{ + `x`: `number`; + `y`: `number`; + \} @@ -409,7 +439,7 @@ const rightCenterCoordinates = xy['right-center'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -439,7 +469,7 @@ const topCenterCoordinates = xy.top(rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -469,7 +499,7 @@ const topCenterCoordinates = xy['top-center'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -499,7 +529,7 @@ const topLeftCoordinates = xy['top-left'](rect); -(`rect`) => [`SpeccerCoordinatesInterface`](../../../types/xy/interfaces/SpeccerCoordinatesInterface.md) +(`rect`) => [`SpeccerCoordinatesInterface`](../types/xy.md#speccercoordinatesinterface) @@ -523,6 +553,32 @@ const topRightCoordinates = xy['top-right'](rect);
-## Defined in +#### Defined in [utils/xy.ts:8](https://github.com/phun-ky/speccer/blob/main/src/utils/xy.ts#L8) + +*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

diff --git a/api/utils/xy/README.md b/api/utils/xy/README.md deleted file mode 100644 index 97fe1d2d..00000000 --- a/api/utils/xy/README.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@phun-ky/speccer**](../../README.md) • **Docs** - -*** - -[@phun-ky/speccer](../../README.md) / utils/xy - -# utils/xy - -## Index - -### Variables - -- [xy](variables/xy.md) diff --git a/custom-typedoc-plugin.js b/custom-typedoc-plugin.js new file mode 100644 index 00000000..358d78c9 --- /dev/null +++ b/custom-typedoc-plugin.js @@ -0,0 +1,94 @@ +/* eslint-disable import/no-unused-modules */ +// @ts-check + +import { MarkdownTheme, MarkdownThemeContext } from 'typedoc-plugin-markdown'; + +/** + * @param {import('typedoc-plugin-markdown').MarkdownApplication} app + */ +export function load(app) { + app.renderer.defineTheme('custom-markdown-theme', MyMarkdownTheme); + + app.renderer.markdownHooks.on( + 'content.begin', + () => `> Last updated ${new Date().toISOString()}` + ); + + app.renderer.markdownHooks.on( + 'page.end', + () => `*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

+` + ); + + app.renderer.markdownHooks.on( + 'index.page.end', + () => `*** + +## Contributing + +Want to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/speccer/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/speccer/blob/main/CODE_OF_CONDUCT.md) + +## Sponsor me + +I'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites. + +The sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :) + +[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky). + +![Speccer banner, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-banner.png?raw=true) + +*** +

+ This project created by + + Alexander Vassbotn Røyne-Helgesen + is licensed under a + + MIT License . +

+` + ); +} + +class MyMarkdownTheme extends MarkdownTheme { + /** + * @param {import('typedoc-plugin-markdown').MarkdownPageEvent} page + */ + getRenderContext(page) { + return new MyMarkdownThemeContext(this, page, this.application.options); + } +} + +class MyMarkdownThemeContext extends MarkdownThemeContext { + partials = { + ...this.partials, + header: () => { + return 'SPECCER logo'; + } + }; +} diff --git a/public/docs/README.md b/public/docs/README.md new file mode 100644 index 00000000..e2af14d4 --- /dev/null +++ b/public/docs/README.md @@ -0,0 +1,5 @@ +# SPECCER API Documentation + +![Speccer hero, with logo and slogan: A zero dependency package to highlight elements](https://github.com/phun-ky/speccer/blob/main/public/speccer-hero.png?raw=true) + +--- diff --git a/src/config/browser.ts b/src/config/browser.ts index 6e33d489..68c4d346 100644 --- a/src/config/browser.ts +++ b/src/config/browser.ts @@ -5,6 +5,13 @@ * > [!NOTE] * > If the activation method is dom or instant, a resize feature is activated, making sure everything is re-rendered on resize. for manual or lazy loading, you are responsible to handle resize yourself. * + * > [!NOTE] + * > Remember to add the CSS file!: + * + * > ```html + * > + * > ``` + * * ## Default implementation * ```html *