import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/feature","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/feature.md","lastUpdated":null}'),o={name:"api/modules/features/feature.md"},n=r('
Ƭ CoercableComponent: string
| DefineComponent
| JSXFunction
Any value that can be coerced into (or is) a vue component
profectus/src/features/feature.ts:25
Ƭ GenericComponent: DefineComponent
<any
, any
, any
>
A type that refers to any vue component
profectus/src/features/feature.ts:35
Ƭ JSXFunction: () => JSX.Element
& { [DoNotCache]
: true
}
A type referring to a function that returns JSX and is marked that it shouldn't be wrapped in a ComputedRef
See
profectus/src/features/feature.ts:21
Ƭ OptionsFunc<T
, R
, S
>: () => T
& Partial
<R
> & ThisType
<T
& S
>
Name | Type |
---|---|
T | T |
R | Record <string , unknown > |
S | R |
▸ (): T
& Partial
<R
> & ThisType
<T
& S
>
Utility function for a function that returns an object of a given type, with "this" bound to what the type will eventually be processed into. Intended for making lazily evaluated objects.
T
& Partial
<R
> & ThisType
<T
& S
>
profectus/src/features/feature.ts:45
Ƭ Replace<T
, S
>: S
& Omit
<T
, keyof S
>
Utility type that is S, with any properties from T that aren't already present in S
Name |
---|
T |
S |
profectus/src/features/feature.ts:38
Ƭ StyleValue: string
| CSSProperties
| (string
| CSSProperties
)[]
Any value that can be passed into an HTML element's style attribute. Note that Profectus uses its own StyleValue and CSSProperties that are extended, in order to have additional properties added to them, such as variable CSS variables.
profectus/src/features/feature.ts:31
• Const
Component: typeof Component
A symbol to use as a key for a vue component a feature can be rendered with
See
profectus/src/features/feature.ts:10
• Const
GatherProps: typeof GatherProps
A symbol to use as a key for a prop gathering function that a feature can use to send to its component
See
profectus/src/features/feature.ts:15
▸ excludeFeatures(obj
, ...types
): unknown
[]
Traverses an object and returns all features that are not any of the given types. Features are any object with a "type" property that has a symbol value.
Name | Type | Description |
---|---|---|
obj | Record <string , unknown > | The object to traverse |
...types | symbol [] | The feature types that will be skipped over |
unknown
[]
profectus/src/features/feature.ts:130
▸ findFeatures(obj
, ...types
): unknown
[]
Traverses an object and returns all features of the given type(s)
Name | Type | Description |
---|---|---|
obj | Record <string , unknown > | The object to traverse |
...types | symbol [] | The feature types that will be searched for |
unknown
[]
profectus/src/features/feature.ts:105
▸ getUniqueID(prefix?
): string
Gets a unique ID to give to each feature, used for any sort of system that needs to identify elements in the DOM rather than references to the feature itself. (For example, branches) IDs are guaranteed unique, but NOT persistent - they likely will change between updates.
Name | Type | Default value | Description |
---|---|---|---|
prefix | string | "feature-" | A string to prepend to the id to make it more readable in the inspector tools |
string
profectus/src/features/feature.ts:56
▸ isHidden(visibility
): boolean
Name | Type |
---|---|
visibility | ProcessedComputable <boolean | Visibility > |
boolean
profectus/src/features/feature.ts:75
▸ isVisible(visibility
): boolean
Name | Type |
---|---|
visibility | ProcessedComputable <boolean | Visibility > |
boolean
profectus/src/features/feature.ts:70
▸ jsx(func
): JSXFunction
Takes a function and marks it as JSX so it won't get auto-wrapped into a ComputedRef. The function may also return empty string as empty JSX tags cause issues.
Name | Type |
---|---|
func | () => "" | Element |
profectus/src/features/feature.ts:84
▸ setDefault<T
, K
>(object
, key
, value
): asserts object is Exclude<T, K> & Required<Pick<T, K>>
Utility function to set a property on an object if and only if it doesn't already exist
Name | Type |
---|---|
T | T |
K | extends string | number | symbol |
Name | Type |
---|---|
object | T |
key | K |
value | T [K ] |
asserts object is Exclude<T, K> & Required<Pick<T, K>>