Skip to content

Commit

Permalink
updated: add internal Riot.js typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Apr 26, 2024
1 parent fe0adc7 commit 9998eac
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions riot.d.ts
Expand Up @@ -5,6 +5,11 @@ import {
AttributeExpressionData,
ExpressionType,
BindingType,
template,
createBinding,
createExpression,
bindingTypes,
expressionTypes,
} from '@riotjs/dom-bindings'

// Internal Types and shortcuts
Expand Down Expand Up @@ -201,3 +206,38 @@ export declare function withTypes<
Component
>,
): Component

/**
* Internal stuff exposed for advanced use cases
* IMPORTANT:
* The things exposed under __ are not part of the official API and might break at any time
* Use it at your own risk!
*/

export interface CSSManager {
CSS_BY_NAME: Map<string, string>
add: (name: string, css: string) => CSSManager
inject: () => CSSManager
remove: (name: string) => CSSManager
}

export declare const __: {
cssManager: CSSManager
DOMBindings: {
template
createBinding
createExpression
bindingTypes
expressionTypes
}
globals: {
PROPS_KEY: string
STATE_KEY: string
IS_COMPONENT_UPDATING: Symbol
ATTRIBUTES_KEY_SYMBOL: Symbol
PARENT_KEY_SYMBOL: Symbol
DOM_COMPONENT_INSTANCE_PROPERTY: Symbol
COMPONENTS_IMPLEMENTATION_MAP: RegisteredComponentsMap
PLUGINS_SET: InstalledPluginsSet
}
}
2 changes: 1 addition & 1 deletion src/api/__.js
Expand Up @@ -7,7 +7,7 @@ import {
PLUGINS_SET,
PROPS_KEY,
STATE_KEY,
} from '@riotjs/util';
} from '@riotjs/util'
import {
bindingTypes,
createBinding,
Expand Down

0 comments on commit 9998eac

Please sign in to comment.