regor 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Ahmed Yasin Koculu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ ![img](https://raw.githubusercontent.com/koculu/regor/main/docs/images/logo1.png)
2
+
3
+ # Regor
4
+
5
+ Regor is a powerful UI framework designed to streamline the development of HTML5-based applications for both web and desktop environments. With a template syntax that closely follows Vue.js, transitioning from VueJS to Regor is seamless for developers familiar with Vue.
6
+
7
+ ## Key Features
8
+
9
+ - **Simplicity:** Develop UIs without a Virtual DOM for a more straightforward implementation and easier debugging.
10
+ - **TypeScript:** Enjoy native TypeScript support without workarounds.
11
+ - **No Build Step Required:** Define components in TypeScript using tagged string templates, no build step needed.
12
+ - **Secure Evaluation:** Regor's secure JavaScript VM ensures safe runtime compilation. You can enable security policy in your page without removing runtime compilation support.
13
+
14
+ ```html
15
+ <meta
16
+ http-equiv="Content-Security-Policy"
17
+ content="require-trusted-types-for 'script';"
18
+ />
19
+ ```
20
+
21
+ - **Flexible Reactivity:** Empowering developers with a highly flexible reactivity system.
22
+ - **Non-JS SSR:** Bind to the existing DOM without removing already mounted HTML elements, suitable for non-JavaScript server-side rendering.
23
+ - **Reentrance:** Regor supports multiple mountings in the previously mounted area using the same or different app contexts. This enables creating and mounting new directives dynamically.
24
+ - **Compatibility:** Rendered pages are designed for seamless integration with other libraries manipulating the DOM.
25
+
26
+ ## Getting started
27
+
28
+ Click and count sample source:
29
+
30
+ ```ts
31
+ import { createApp, ref } from 'regor'
32
+
33
+ createApp({
34
+ count: ref(0),
35
+ })
36
+ ```
37
+
38
+ HTML:
39
+
40
+ ```html
41
+ <div id="app">
42
+ <button @click="count++">Count is: {{ count }}</button>
43
+ </div>
44
+ ```
45
+
46
+ Defining component:
47
+
48
+ ```ts
49
+ import { createApp, createComponent, ref, html, type Ref } from 'regor'
50
+
51
+ interface MyComponent {
52
+ message: Ref<string>
53
+ }
54
+
55
+ const myComponent = createComponent<MyComponent>(
56
+ 'MyComponent',
57
+ (head) => ({
58
+ message: head.props.message,
59
+ count: ref(0),
60
+ }),
61
+ {
62
+ html: html`<button @click="count++">{{ message }} {{ count }}</button>`,
63
+ },
64
+ {
65
+ props: ['message'],
66
+ },
67
+ )
68
+
69
+ createApp({
70
+ components: { myComponent },
71
+ message: ref('Count is:'),
72
+ })
73
+ ```
74
+
75
+ HTML:
76
+
77
+ ```html
78
+ <div id="app">
79
+ <MyComponent :message="message"></MyComponent>
80
+ </div>
81
+ ```
82
+
83
+ ## Installation
84
+
85
+ `yarn add regor`
86
+
87
+ ## Comparison with VueJs
88
+
89
+ Regor shares core functionality with VueJs but differs in implementation, TypeScript support, template evaluation, reactivity, server-side rendering support, compatibility.
90
+
91
+ ## Supported Directives
92
+
93
+ Regor provides a set of directives that allow you to enhance the behavior and appearance of your applications. Similar to Vue's directives, Regor's directives start with the "r-" prefix.
94
+
95
+ > **Note:** The directive prefix "r-" can be customized using `RegorConfig.getDefault().setDirectives('v-')` to align with a different naming convention, such as Vue's "v-" prefix.
96
+
97
+ - **r-bind:** Binds an element's attribute to a component's data, allowing dynamic updates.
98
+ - **r-model:** Enables two-way data binding between form inputs.
99
+ - **r-text:** Sets the element's text content to the result of an expression.
100
+ - **r-html:** Renders the result of an expression as HTML content within the element.
101
+ - **r-on:** Attaches event listeners to the element and invokes specified component methods.
102
+ - **r-show:** Conditionally displays the element based on the truthiness of an expression.
103
+ - **r-for:** Renders a set of elements based on an array and a template.
104
+ - **r-if:** Conditionally renders the element based on the truthiness of an expression.
105
+ - **r-else:** Provides an alternative rendering when used in conjunction with r-if.
106
+ - **r-else-if:** Conditionally renders the element as an alternative to r-if.
107
+ - **r-pre:** Excludes HTML element from Regor bindings.
108
+ - **:class:** Binds one or more class names to an element based on expressions.
109
+ - **:style:** Binds one or more inline styles to an element based on expressions.
110
+ - **:ref:** Provides a reference to an element in the template, allowing you to interact with it programmatically.
111
+ - **:key:** Provides a unique identifier for each item in a list, aiding efficient updates and rendering.
112
+ - **:is:** Specifies the component to dynamically render based on a value or expression.
113
+ - **r-teleport:** Teleports the element to anywhere in the DOM. Unlike Vue, teleport is a directive to avoid component overhead.
114
+ - **:props:** Vue uses v-bind for component property passing. However, this can conflict with v-bind's attribute fall-through logic. Hence, Regor defines a dedicated directive to pass properties using object syntax. It enables passing properties without defining them in the component's props contract.
115
+ - **:props-once:** Similar to :props but it doesn't observe entire reactive tree of the template expression. Tail reactivity still works.
116
+ - **@** Shorthand for `r-on` to bind event listeners.
117
+ - **:** Shorthand for `r-bind` to bind element attributes.
118
+ - **.** Shorthand for `r-bind.prop` to set properties.
119
+
120
+ These directives empower you to create dynamic and interactive user interfaces, enhancing the user experience of your Regor-powered applications.
121
+
122
+ ## Regor API
123
+
124
+ **App / Component Template Functions**
125
+
126
+ - **createApp:** Similar to Vue's `createApp`, it initializes a Regor application instance.
127
+ - **createComponent:** Creates a Regor component instance, akin to Vue's component creation.
128
+ - **toFragment:** Converts a JSON template to a DOM element fragment.
129
+ - **toJsonTemplate:** Converts a DOM element to a JSON template.
130
+
131
+ **Cleanup Functions**
132
+
133
+ - **addUnbinder:** Adds an unbinder to a DOM element.
134
+ - **getBindData:** Retrieves bind data associated with a DOM element.
135
+ - **removeNode:** Removes a node while properly disposing of associated bind data and observers.
136
+ - **unbind:** Unbinds a node, disposing of observers and bind data.
137
+
138
+ **Compute Functions**
139
+
140
+ - **computed:** Similar to Vue's `computed`, it creates a computed property.
141
+ - **computeRef:** Computes the value observing a single ref, more efficient than observing any.
142
+ - **computeMany:** Computes the value observing given refs, more efficient than observing any.
143
+ - **watchEffect:** Similar to Vue's `watchEffect`, it watches for reactive changes.
144
+ - **collectRefs:** Like `watchEffect`, but runs once and returns all refs used in the evaluated action.
145
+ - **silence:** Silences the ref collection in a `watchEffect` or `collectRefs`.
146
+
147
+ **Misc Functions**
148
+
149
+ - **flatten:** Flattens a given ref object into a raw object recursively.
150
+ - **isRaw:** Checks if a given ref is marked as raw.
151
+ - **markRaw:** Marks a ref as raw.
152
+ - **persist:** Persists a given ref in local storage reactively.
153
+ - **html:** A tag to produce HTML string using template literals. Recommended to use with the VS-Code [`lit-html`](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension for formatting and highlighting.
154
+ - **raw:** A tag to produce HTML string, similar to `html`, but it is excluded from formatting when [`lit-html`](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension is installed.
155
+
156
+ **Observe Functions**
157
+
158
+ - **observe:** Observes changes in a single ref.
159
+ - **observeMany:** Observes changes in multiple refs.
160
+ - **observerCount:** Retrieves the active observer count of a ref.
161
+ - **batch:** Performs batch updates, triggering changes at the end. Use with caution due to possible dirty reads.
162
+ - **startBatch:** Starts a batch update.
163
+ - **endBatch:** Ends a started batch update and triggers affected refs.
164
+
165
+ **Reactivity Functions**
166
+
167
+ - **ref:** Creates a deep ref object recursively, modifying the source object in place.
168
+ - **sref:** Creates a simple ref object from a given value, without nested ref creation.
169
+ - **isDeepRef:** Returns true if a given ref is created with `ref()` function.
170
+ - **isRef:** Returns true for any ref, false for non-refs.
171
+ - **pause:** Pauses a ref's auto-trigger on value change.
172
+ - **resume:** Resumes a ref's auto-trigger on value change.
173
+ - **trigger:** Manually triggers a ref to inform its observers.
174
+ - **unref:** Unwraps a ref, returning the raw value.
175
+ - **entangle:** Entangles two refs to sync their value changes.
176
+
177
+ **Composition Functions**
178
+
179
+ - **useScope:** In a scope, you can use `onMounted` and `onUnmounted` functions. Components are always created in scope. Use the useScope for apps created by createApp. Similar to Vue's `effectScope`, useScope provides efficient cleanup of watchEffects, computed refs and enables the `onMounted` and `onUnmounted` usage.
180
+ - **onMounted:** Similar to Vue's `onMounted`, it executes when the component is mounted.
181
+ - **onUnmounted:** Similar to Vue's `onUnmounted`, it executes when the component is unmounted.
182
+
183
+ **Log Configuration**
184
+
185
+ - **warningHandler:** Customize or turn off console warnings.
186
+
187
+ ## Contributing
188
+
189
+ This project welcomes contributions and suggestions. Please follow [CONTRIBUTING.md](.github/CONTRIBUTING.md) instructions.
190
+
191
+ ## Acknowledgments
192
+
193
+ Regor is built upon the shoulders of giants, drawing inspiration from Vue and its vibrant community of contributors. The well-defined concepts and principles from Vue have played a pivotal role in shaping Regor's foundation. We extend our heartfelt gratitude to the Vue project and its dedicated contributors for their pioneering work in the realm of UI frameworks.
194
+
195
+ Special thanks to the Vue team and its community for creating a thriving ecosystem that continues to inspire innovation in the field of web development.
196
+
197
+ Regor also utilizes [**Jsep**](https://github.com/EricSmekens/jsep), a fast and lightweight JavaScript expression parser. Jsep's contribution to Regor's functionality is greatly appreciated.
198
+
199
+ Additionally, we would like to acknowledge the [**happy-dom**](https://github.com/capricorn86/happy-dom) library, which played a significant role in our testing process.
200
+
201
+ We also extend a warm welcome to any future contributors who join the Regor project. Your contributions will play a vital role in shaping the framework's growth and evolution.
202
+
203
+ Thank you to everyone who has contributed, inspired, and supported Regor's development journey. Your dedication and passion are invaluable.
@@ -0,0 +1,267 @@
1
+ // Generated by dts-bundle-generator v8.0.1
2
+
3
+ export declare class ComponentHead<TProps = Record<any, any>> {
4
+ props: TProps;
5
+ start: Comment;
6
+ end: Comment;
7
+ ctx: IRegorContext[];
8
+ /** Automatically assigns properties defined in the :props binding to the component context when enabled. If disabled, props should be manually assigned using head.props.
9
+ * Default: true */
10
+ autoProps: boolean;
11
+ /** When both autoProps and entangle are enabled,
12
+ * the refs defined in the component context (without using head.props)
13
+ * become entangled with the head.props refs. (parent[ref] <==> component[ref])
14
+ * This means that changes to parent[ref] reflect in component[ref], and vice versa.
15
+ * Disable this flag to isolate refs created within the component context.
16
+ * Default: true */
17
+ entangle: boolean;
18
+ /** disables slot context switch to the parent */
19
+ disableSwitch: boolean;
20
+ /** A callback invoked after auto props get assigned to the component context. */
21
+ onAutoPropsAssigned?: () => void;
22
+ constructor(props: TProps, element: Element, ctx: IRegorContext[], start: Comment, end: Comment);
23
+ /** use arrow syntax to be called without using head.emit.bind(head) in Binder.ts. */
24
+ emit: (event: string, args: Record<any, any>) => void;
25
+ unmount(): void;
26
+ }
27
+ export declare class RegorConfig {
28
+ static getDefault(): RegorConfig;
29
+ forGrowThreshold: number;
30
+ globalContext: Record<string, any>;
31
+ useInterpolation: boolean;
32
+ constructor(globalContext?: Record<any, any>);
33
+ addComponent<TProps = Record<any, any>>(...components: Array<Component<TProps>>): void;
34
+ setDirectives(prefix: string): void;
35
+ updateDirectives(updater: (directiveMap: Record<string, Directive>, builtInNames: Record<string, string>) => void): void;
36
+ }
37
+ export type IsNull<T> = [
38
+ T
39
+ ] extends [
40
+ null
41
+ ] ? true : false;
42
+ export type Equals<T, U> = T extends U ? (U extends T ? true : false) : false;
43
+ export type RawTypes = string | Function | number | boolean | symbol | undefined | null | bigint | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object> | Node | EventTarget | Event | RawMarker | Date | RegExp | Promise<unknown> | Error;
44
+ declare const RefSymbol: unique symbol;
45
+ declare const RawSymbol: unique symbol;
46
+ declare const ScopeSymbol: unique symbol;
47
+ export type AnyRef = (newValue?: unknown, eventSource?: unknown) => any & {
48
+ [RefSymbol]: true;
49
+ };
50
+ export type Ref<TValueType> = ((newValue?: RefContent<TValueType> | Ref<RefParam<TValueType>> | SRef<RefContent<TValueType>>, eventSource?: any) => RefContent<TValueType>) & AnyRef & {
51
+ value: RefContent<TValueType>;
52
+ };
53
+ export type SRef<TValueType> = ((newValue?: TValueType | SRef<TValueType>, eventSource?: any) => SRefContent<TValueType>) & AnyRef & {
54
+ value: SRefContent<TValueType>;
55
+ };
56
+ export type ComputedRef<TValueType> = SRef<TValueType> & {
57
+ stop: StopObserving;
58
+ };
59
+ export interface RawMarker {
60
+ [RawSymbol]: true;
61
+ }
62
+ export type RefContent<TValueType> = TValueType extends undefined ? never : TValueType extends Ref<infer V1> ? RefContent<V1> : TValueType extends SRef<infer V2> ? V2 : TValueType extends Array<infer V3> ? Array<Ref<RefParam<V3>>> : TValueType extends RawTypes ? TValueType : {
63
+ [Key in keyof TValueType]: Key extends symbol ? TValueType[Key] : TValueType[Key] extends Ref<infer V4> ? Ref<RefParam<V4>> : TValueType[Key] extends SRef<infer V5> ? Ref<RefParam<V5>> : TValueType[Key] extends RawMarker ? TValueType[Key] : Ref<RefParam<TValueType[Key]>>;
64
+ };
65
+ export type RefParam<TValueType> = Equals<TValueType, MakeRefParam<TValueType>> extends true ? TValueType : MakeRefParam<TValueType>;
66
+ export type MakeRefParam<TValueType> = TValueType extends undefined ? never : TValueType extends Ref<infer V1> ? MakeRefParam<V1> : TValueType extends SRef<infer V2> ? MakeRefParam<V2> : TValueType extends Array<infer V3> ? Array<MakeRefParam<V3>> : TValueType extends RawTypes ? TValueType : {
67
+ [Key in keyof TValueType]: TValueType[Key] extends Ref<infer V4> ? MakeRefParam<V4> : TValueType[Key] extends SRef<infer V5> ? MakeRefParam<V5> : MakeRefParam<TValueType[Key]>;
68
+ };
69
+ export type SRefContent<TValueType> = Equals<TValueType, MakeSRefContent<TValueType>> extends true ? TValueType : MakeSRefContent<TValueType>;
70
+ export type MakeSRefContent<TValueType> = TValueType extends undefined ? never : TValueType extends Ref<infer V1> ? RefContent<V1> : TValueType extends SRef<infer V2> ? V2 : TValueType extends Array<infer V3> ? V3[] : TValueType extends RawTypes ? TValueType : TValueType;
71
+ export type UnwrapRef<TRef> = TRef extends Ref<infer V1> ? RefContent<V1> : TRef extends SRef<infer V2> ? SRefContent<V2> : TRef;
72
+ export type FlattenRef<TRef> = TRef extends Array<infer V1> ? Array<FlattenRef<V1>> : TRef extends Ref<infer V2> ? FlattenRef<V2> : TRef extends SRef<infer V3> ? FlattenRef<V3> : TRef extends AnyRef ? unknown : TRef extends RawTypes ? TRef : {
73
+ [Key in keyof TRef]: FlattenRef<TRef[Key]>;
74
+ };
75
+ export type ObserveCallback<TValueType> = (newValue: TValueType, eventSource?: any) => void;
76
+ export type StopObserving = () => void;
77
+ export declare interface IRegorContext extends Record<any, any> {
78
+ components?: Record<string, Component<any>>;
79
+ mounted?: () => void;
80
+ unmounted?: () => void;
81
+ }
82
+ export type IsLazy = (i: number, d: number) => boolean;
83
+ export type IsLazyKey = (key: string, d: number) => boolean;
84
+ export interface Directive {
85
+ isLazy?: IsLazy;
86
+ isLazyKey?: IsLazyKey;
87
+ collectRefObj?: boolean;
88
+ /** if once is enabled, the onChange is never triggered.
89
+ * The refs in parseResult are still reactive. */
90
+ once?: boolean;
91
+ /** Called on every value change. */
92
+ onChange?: (el: HTMLElement, values: any[], previousValues?: any[], option?: any, previousOption?: any, flags?: string[]) => void;
93
+ /** Called on binding. Returns unbinder. */
94
+ onBind?: (el: HTMLElement, parseResult: ParseResult, expr: string, option?: string, dynamicOption?: ParseResult, flags?: string[]) => Unbinder;
95
+ }
96
+ export interface BindData {
97
+ unbinders: Unbinder[];
98
+ data: Record<any, any>;
99
+ }
100
+ export type Unbinder = () => void;
101
+ export interface ParseResult {
102
+ value: SRef<unknown[]>;
103
+ stop: StopObserving;
104
+ refs: Array<AnyRef | undefined>;
105
+ context: Record<any, any>;
106
+ }
107
+ export type OnCleanup = (cleanup: () => void) => void;
108
+ export interface JSONTemplate {
109
+ /** tag-name */
110
+ t?: string;
111
+ /** attributes */
112
+ a?: Record<string, string>;
113
+ /** children */
114
+ c?: JSONTemplate[];
115
+ /** text node content */
116
+ d?: string;
117
+ /** node type if node is COMMENT_NODE */
118
+ n?: number;
119
+ }
120
+ /**
121
+ * Represents a template configuration for rendering a component or an app.
122
+ * If used with 'createApp':
123
+ * - Define either 'selector' or 'element' to specify the mounting point.
124
+ * - Optionally, 'html' or 'json' can be defined to override the inner HTML of the mounting point.
125
+ * - If neither 'html' nor 'json' template is defined, the mounting point's inner HTML remains unchanged.
126
+ * If used with 'createComponent':
127
+ * - Define only one option: 'selector', 'element', 'html', or 'json'. The single option defines the component's HTML template.
128
+ */
129
+ export interface Template {
130
+ /**
131
+ * If used with 'createApp', specifies the target root element for mounting the application.
132
+ * If used with 'createComponent', identifies the component template using a selector.
133
+ */
134
+ selector?: string;
135
+ /**
136
+ * If used with 'createApp', represents the actual DOM element where the app will be mounted.
137
+ * If used with 'createComponent', specifies the component template using an element.
138
+ * Use this property if you already have a reference to the target element.
139
+ */
140
+ element?: Node;
141
+ /**
142
+ * If used with 'createApp', HTML template string that will replace the content of the root element defined by 'selector' or 'element'.
143
+ * If used with 'createComponent', this template populates the content of the component.
144
+ */
145
+ html?: string;
146
+ /**
147
+ * JSON-based template representation, enabling rendering within secure contexts.
148
+ * Can be a single JSONTemplate object or an array of JSONTemplate objects.
149
+ * This property is applicable to both 'createApp' and 'createComponent'.
150
+ */
151
+ json?: JSONTemplate | JSONTemplate[];
152
+ /**
153
+ * Indicates whether the component template contains SVG elements.
154
+ * Enable this flag if SVG content is present to ensure proper rendering.
155
+ * This property is applicable to both 'createApp' and 'createComponent'.
156
+ */
157
+ isSVG?: boolean;
158
+ }
159
+ export interface App<TRegorContext extends IRegorContext> {
160
+ context: TRegorContext;
161
+ unmount: () => void;
162
+ unbind: () => void;
163
+ }
164
+ export interface Component<TProps = Record<any, any>> {
165
+ name: string;
166
+ context: (head: ComponentHead<TProps>) => IRegorContext;
167
+ template: Template;
168
+ inheritAttrs?: boolean;
169
+ props?: string[];
170
+ }
171
+ export type OnMounted = () => void;
172
+ export type OnUnmounted = () => void;
173
+ export interface CreateComponentOptions {
174
+ useInterpolation?: boolean;
175
+ config?: RegorConfig;
176
+ inheritAttrs?: boolean;
177
+ /**
178
+ * Notes on component props:
179
+ * The props defined in the props list can be used with :foo or r-bind:foo syntax.
180
+ * <MyComponent :prop-kebab-1="1" r-bind:prop-kebab-2="x ? 1 : 0" :props="{ propFoo3: true, propFoo4: x ? 'a' : 'b' }></MyComponent>
181
+ * It is required to define prop-kebab-1 and prop-kebab-2 in the props list camelized.
182
+ * It is not required to define propFoo3 and propFoo4 in the props list because it uses :props binding. :props binding enables binding to any property of component regardless it is explicitly defined in props list.
183
+ */
184
+ props?: string[];
185
+ }
186
+ export interface Scope<TRegorContext> {
187
+ context: TRegorContext;
188
+ unmount: () => void;
189
+ [ScopeSymbol]: true;
190
+ }
191
+ export declare const createApp: <TRegorContext extends IRegorContext>(context: TRegorContext | Scope<TRegorContext>, template?: Template, config?: RegorConfig) => App<TRegorContext>;
192
+ export declare const createComponent: <TProps = Record<any, any>>(name: string, context: (head: ComponentHead<TProps>) => IRegorContext, template: Template, options?: CreateComponentOptions) => Component<TProps>;
193
+ export declare const toFragment: (json: JSONTemplate | JSONTemplate[], isSVG?: boolean, config?: RegorConfig) => DocumentFragment;
194
+ export declare const toJsonTemplate: (node: Element | Element[]) => JSONTemplate | JSONTemplate[];
195
+ export declare const addUnbinder: (node: Node, unbinder: Unbinder) => void;
196
+ export declare const getBindData: (node: any) => BindData;
197
+ export declare const removeNode: (node: ChildNode) => void;
198
+ export declare const unbind: (node: Node) => void;
199
+ export declare const computed: <TReturnType>(compute: () => TReturnType) => ComputedRef<UnwrapRef<TReturnType>>;
200
+ export declare const computeMany: <TReturnType>(sources: AnyRef[], compute: (...values: any[]) => TReturnType) => ComputedRef<UnwrapRef<TReturnType>>;
201
+ export declare const computeRef: <TValueType extends AnyRef, TReturnType>(source: TValueType, compute: (value: UnwrapRef<TValueType>) => TReturnType) => ComputedRef<UnwrapRef<TReturnType>>;
202
+ export declare const watchEffect: (effect: (onCleanup?: OnCleanup) => void) => StopObserving;
203
+ export declare const silence: <TReturnType>(action: () => TReturnType) => TReturnType;
204
+ export declare const collectRefs: <TReturnType>(action: () => TReturnType) => {
205
+ value: TReturnType;
206
+ refs: AnyRef[];
207
+ };
208
+ export declare const flatten: <TValueType>(reference: TValueType) => FlattenRef<TValueType>;
209
+ export declare const isRaw: (value: any) => boolean;
210
+ export type Raw<TValueType> = TValueType & RawMarker;
211
+ export declare const markRaw: <TValueType extends object>(value: TValueType) => Raw<TValueType>;
212
+ export declare const persist: <TRef extends AnyRef>(anyRef: TRef, key: string) => TRef;
213
+ export declare const html: (templates: TemplateStringsArray, ...args: any[]) => string;
214
+ export declare const raw: (templates: TemplateStringsArray, ...args: any[]) => string;
215
+ export declare const observe: <TValueType extends AnyRef>(source: TValueType, observer: ObserveCallback<UnwrapRef<TValueType>>, init?: boolean) => StopObserving;
216
+ export declare const observeMany: (sources: AnyRef[], observer: ObserveCallback<any[]>, init?: boolean) => StopObserving;
217
+ export declare const observerCount: <TValueType extends AnyRef>(source: TValueType) => number;
218
+ export declare const batch: (updater: () => void) => void;
219
+ export declare const startBatch: () => void;
220
+ export declare const endBatch: () => void;
221
+ export declare const isDeepRef: (value: unknown) => value is AnyRef;
222
+ export declare const isRef: (value: unknown) => value is AnyRef;
223
+ export declare const pause: <TValueType extends AnyRef>(source: TValueType) => void;
224
+ /**
225
+ * Converts the given value and it's all properties to ref objects and returns the ref.
226
+ * The returned object's type reflects it's nested properties as well.
227
+ * Regor provides two options to get or update the value of a ref.
228
+ * Getting the ref value:
229
+ * 1. refObj.value
230
+ * 2. refObj()
231
+ * Setting the ref value:
232
+ * 1. refObj.value = newValue
233
+ * 2. refObj(newValue)
234
+ *
235
+ * @param value any value
236
+ * @returns ref
237
+ */
238
+ export declare const ref: <TValueType>(value?: TValueType | RefContent<TValueType> | RefParam<TValueType> | (TValueType extends Ref<infer V1> ? Ref<RefParam<V1>> : never) | (TValueType extends SRef<infer V2> ? SRef<UnwrapRef<V2>> : never) | (TValueType extends (infer V1_1)[] ? V1_1[] : never) | null | undefined) => IsNull<TValueType> extends true ? Ref<unknown> : Ref<RefParam<TValueType>>;
239
+ export declare const resume: <TValueType extends AnyRef>(source: TValueType) => void;
240
+ /**
241
+ * Converts the given value to sref object and returns the sref.
242
+ * Regor provides two options to get or update the value of a sref.
243
+ * Getting the sref value:
244
+ * 1. refObj.value
245
+ * 2. refObj()
246
+ * Setting the sref value:
247
+ * 1. refObj.value = newValue
248
+ * 2. refObj(newValue)
249
+ *
250
+ * @param value any value
251
+ * @returns ref
252
+ */
253
+ export declare const sref: <TValueType>(value?: TValueType | (TValueType extends SRef<infer V2> ? SRef<UnwrapRef<V2>> : never) | (TValueType extends (infer V1)[] ? V1[] : never) | null | undefined) => IsNull<TValueType> extends true ? SRef<unknown> : SRef<SRefContent<TValueType>>;
254
+ export declare const trigger: <TValueType extends AnyRef>(source: TValueType, eventSource?: any, isRecursive?: boolean) => void;
255
+ export declare const unref: <TValueType>(value: TValueType) => UnwrapRef<TValueType>;
256
+ export declare const entangle: (r1: AnyRef, r2: AnyRef) => StopObserving;
257
+ export declare const useScope: <TRegorContext extends IRegorContext>(context: () => TRegorContext) => Scope<TRegorContext>;
258
+ export declare const onMounted: (onMounted: OnMounted) => void;
259
+ export declare const onUnmounted: (onUnmounted: OnUnmounted, noThrow?: boolean) => void;
260
+ export declare const warningHandler: {
261
+ warning: {
262
+ (...data: any[]): void;
263
+ (message?: any, ...optionalParams: any[]): void;
264
+ };
265
+ };
266
+
267
+ export {};