@regle/mcp-server 1.18.3 → 1.19.0-beta.1
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/dist/regle-mcp-server.js +54 -33
- package/package.json +1 -1
package/dist/regle-mcp-server.js
CHANGED
|
@@ -20,7 +20,7 @@ var docs_data_default = {
|
|
|
20
20
|
"title": "Global configuration",
|
|
21
21
|
"category": "advanced-usage",
|
|
22
22
|
"path": "advanced-usage/global-config.md",
|
|
23
|
-
"content": "# Global configuration\n\nIf your app includes multiple forms, it can be helpful to define a global configuration that centralizes your custom validators, error messages, and modifiers. This eliminates the need to declare these settings repeatedly for every `useRegle` call, improving both code consistency and developer experience with features like autocompletion and type checking.\n\n## Replace built-in rules messages\n\nEach `@regle/rules` rule provides a default error message. You may not want to call `withMessage` every time you need to use one with a custom error message.\n\n`defineRegleConfig` allows you to redefine the default messages of built-in rules.\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required } from '@regle/rules';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n required: withMessage(required, 'You need to provide a value'),\n minLength: withMessage(minLength, ({ $value, $params: [min] }) => {\n return `Minimum length is ${min}. Current length: ${$value?.length}`;\n })\n })\n})\n\nconst { r$ } = useCustomRegle({ name: '' }, {\n name: {\n required,\n minLength: minLength(6)\n }\n})\n```\n\nResult: \n\n:::tip\nIf you use Nuxt, check out the [Nuxt module](/integrations/nuxt) for a even better DX. \nIt provides a way to add your custom global config to your auto-imports.\n:::\n\n
|
|
23
|
+
"content": "# Global configuration\n\nIf your app includes multiple forms, it can be helpful to define a global configuration that centralizes your custom validators, error messages, and modifiers. This eliminates the need to declare these settings repeatedly for every `useRegle` call, improving both code consistency and developer experience with features like autocompletion and type checking.\n\nRegle offers two ways to define your global configuration:\n\n- **Composable** — use `defineRegleConfig` to create a custom `useRegle` composable that encapsulates your configuration. Best for scoped or modular setups.\n- **Declarative** — use `defineRegleOptions` with the `RegleVuePlugin` to provide configuration at the app level via Vue's plugin system. Best for app-wide defaults that apply everywhere, including the default `useRegle`.\n\n## Composable {#composable}\n\n`defineRegleConfig` creates and returns a custom `useRegle` composable (along with `inferRules` and `useRules`) that has your configuration baked in. This is ideal when you want strong typing and autocompletion for your custom rules.\n\n### Replace built-in rules messages\n\nEach `@regle/rules` rule provides a default error message. You may not want to call `withMessage` every time you need to use one with a custom error message.\n\n`defineRegleConfig` allows you to redefine the default messages of built-in rules.\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required } from '@regle/rules';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n required: withMessage(required, 'You need to provide a value'),\n minLength: withMessage(minLength, ({ $value, $params: [min] }) => {\n return `Minimum length is ${min}. Current length: ${$value?.length}`;\n })\n })\n})\n\nconst { r$ } = useCustomRegle({ name: '' }, {\n name: {\n required,\n minLength: minLength(6)\n }\n})\n```\n\nResult: \n\n:::tip\nIf you use Nuxt, check out the [Nuxt module](/integrations/nuxt) for a even better DX. \nIt provides a way to add your custom global config to your auto-imports.\n:::\n\n#### i18n\n\nYou can also use any i18n library directly inside the config.\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required } from '@regle/rules';\nimport { useI18n } from 'vue-i18n';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => {\n const { t } = useI18n()\n\n return {\n required: withMessage(required, t('general.required')),\n minLength: withMessage(minLength, ({ $value, $params: [max] }) => {\n return t('general.minLength', {max});\n })\n }\n }\n})\n```\n\n### Declare new rules\n\nWhile `useRegle` allows you to use any rule key, adding custom rules to the global configuration provides autocompletion and type checking. This improves maintainability and consistency across your application.\n\n```ts twoslash\nconst someAsyncCall = async () => await Promise.resolve(true);\n// ---cut---\n\nimport { defineRegleConfig, createRule, type Maybe } from '@regle/core';\nimport { withMessage, isFilled } from '@regle/rules';\n\nconst asyncEmail = createRule({\n async validator(value: Maybe<string>) {\n if (!isFilled(value)) {\n return true;\n }\n\n const result = await someAsyncCall();\n return result;\n },\n message: 'Email already exists',\n});\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n asyncEmail\n })\n})\n\nconst { r$ } = useCustomRegle({ name: '' }, {\n name: {\n asy\n\n }\n})\n```\n\n### Declare modifiers\n\nYou can include global modifiers in your configuration to automatically apply them wherever you use the `useRegle` composable. This avoids repetitive declarations and keeps your code clean.\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required } from '@regle/rules';\n\nexport const { useRegle: useCustomRegle } = defineRegleConfig({\n modifiers: {\n autoDirty: false,\n silent: true,\n lazy: true,\n rewardEarly: true\n }\n})\n```\n\n### Export scoped `inferRules` helper\n\n`defineRegleConfig` also returns a scoped `inferRules` helper, similar to the one exported from `@regle/core`, but that will autocomplete and check your custom rules.\n\nFor information about `inferRules`, check [Typing rules docs](/typescript/typing-rules)\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required } from '@regle/rules';\n\nexport const { useRegle, inferRules } = defineRegleConfig({/* */})\n```\n\n### Extend global config\n\nIt's also possible to add additional config to an already created custom `useRegle`.\n\nWith `extendRegleConfig`, you can recreate a custom one with a existing composable as an input.\n\n```ts twoslash\n\nimport { defineRegleConfig, extendRegleConfig, createRule } from '@regle/core';\nimport { withMessage, required } from '@regle/rules';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n customRule: withMessage(required, 'Custom rule'),\n })\n})\n\nconst {useRegle: useExtendedRegle} = extendRegleConfig(useCustomRegle, {\n rules: () => ({\n customRuleExtended: withMessage(required, 'Custom rule 2'),\n })\n})\n\nuseExtendedRegle({name: ''}, {\n name: {\n custom\n \n }\n})\n\n```\n\n## Declarative {#declarative}\n\nThe declarative approach uses `defineRegleOptions` combined with the `RegleVuePlugin` to provide global configuration at the Vue app level. The configuration is injected via Vue's `provide/inject` mechanism, so it applies to every `useRegle` call in your application — including the default one from `@regle/core`.\n\nThis is especially useful when you want app-wide defaults without needing to import a custom composable everywhere.\n\n### Setup\n\nPass your options as the second argument to `app.use`:\n\n```ts [main.ts]\nimport { createApp } from 'vue';\nimport { RegleVuePlugin, defineRegleOptions } from '@regle/core';\nimport { withMessage, required, minLength } from '@regle/rules';\nimport App from './App.vue';\n\nconst options = defineRegleOptions({\n rules: () => ({\n required: withMessage(required, 'You need to provide a value'),\n minLength: withMessage(minLength, ({ $value, $params: [min] }) => {\n return `Minimum length is ${min}. Current length: ${$value?.length}`;\n })\n }),\n modifiers: {\n autoDirty: false,\n },\n shortcuts: {\n fields: {\n $isRequired: (field) => field.$rules.required?.$active ?? false,\n },\n },\n});\n\nconst app = createApp(App);\n\n// Add the options to the RegleVuePlugin\napp.use(RegleVuePlugin, options);\n\napp.mount('#app');\n```\n\nNow, every `useRegle` call in your app will automatically use the configured rules and modifiers — no need to import a custom composable.\n\n```vue\n\n```\n\n### Type augmentation\n\nTo get full type-safety and autocompletion with the declarative approach, you can augment Regle's interfaces using TypeScript module augmentation. This lets the default `useRegle` composable know about your custom rules and shortcut properties.\n\n```ts [regle.config.ts]\nimport { createRule } from '@regle/core';\n\nconst customRule = createRule({\n validator: (value: unknown) => value === 'custom',\n message: 'Custom rule',\n});\n\ndeclare module '@regle/core' {\n interface CustomRules {\n customRule: typeof customRule;\n }\n interface CustomFieldProperties {\n $isRequired: boolean;\n }\n interface CustomNestedProperties {\n $isEmpty: boolean;\n }\n interface CustomCollectionProperties {\n $isEmpty: boolean;\n }\n}\n```\n\n### Combining with composable configuration\n\nIf both the plugin options and a `defineRegleConfig` composable are used, the composable's configuration takes precedence and is merged on top of the plugin's. This lets you set app-wide defaults via the plugin while still allowing scoped overrides where needed.\n\n## Override default behaviors\n\nYou can override the default behaviors of Regle processors by using the `overrides` property. This works with both the composable and declarative approaches.\n\n### `isEdited`\n\nOverride the default `$edited` property handler. Useful to handle custom comparisons for complex object types.\n\n:::warning\nIt's highly recommended to use this override with the [`markStatic`](/advanced-usage/immutable-constructors) helper to handle immutable constructors.\n:::\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { Decimal } from 'decimal.js';\n\nexport const { useRegle: useCustomRegle } = defineRegleConfig({\n overrides: {\n isEdited(currentValue, initialValue, defaultHandlerFn) {\n if (currentValue instanceof Decimal && initialValue instanceof Decimal) {\n return currentValue.toNearest(0.01).toString() !== initialValue.toNearest(0.01).toString();\n }\n // fallback to the default handler\n return defaultHandlerFn(currentValue, initialValue);\n },\n },\n})\n\n// Or with the declarative approach\nimport { defineRegleOptions } from '@regle/core';\n\nconst options = defineRegleOptions({\n overrides: {\n isEdited: (currentValue, initialValue, defaultHandlerFn) => {\n return currentValue !== initialValue;\n },\n },\n});\n\napp.use(RegleVuePlugin, options);\n```"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"id": "advanced-usage-immutable-constructors",
|
|
@@ -246,6 +246,13 @@ var docs_data_default = {
|
|
|
246
246
|
"path": "examples/simple.md",
|
|
247
247
|
"content": "# Simple demo\n\nYou can play with the code of this example in the stackblitz sandbox.\n\nDon't forgot to install the `Vue` extension in the online IDE.\n\n<a target='_blank' href=\"https://stackblitz.com/~/github.com/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?file=examples/simple-example/src/App.vue&configPath=examples/simple-example\">\n <img\n alt=\"Open in StackBlitz\"\n src=\"https://developer.stackblitz.com/img/open_in_stackblitz.svg\"\n />\n</a>\n\n<iframe style='width: 100%; height: 700px' src=\"https://stackblitz.com/github/victorgarciaesgi/regle-examples/tree/main/examples/simple-example?embed=1&file=src%2FApp.vue&theme=dark&view=preview\" title=\"Sandbox editor\" sandbox=\"allow-modals allow-forms allow-popups allow-scripts allow-same-origin\"></iframe>"
|
|
248
248
|
},
|
|
249
|
+
{
|
|
250
|
+
"id": "integrations-agent-skills",
|
|
251
|
+
"title": "Agent Skills",
|
|
252
|
+
"category": "integrations",
|
|
253
|
+
"path": "integrations/agent-skills.md",
|
|
254
|
+
"content": "# Agent Skills\n\n[Agent Skills](https://skills.sh/) are reusable capabilities for AI coding agents. They provide procedural knowledge that helps agents write Regle validation code more effectively.\n\nRegle provides three skills covering core usage, advanced patterns, and TypeScript integration.\n\n## Install\n\n```bash\nnpx skills add victorgarciaesgi/regle\n```\n\nThis installs all three Regle skills and configures them for your AI agent.\n\n## Available skills\n\n### `regle`\n\nCore Regle usage:\n\n- `useRegle` composable (state, rules, `r$` object)\n- Built-in validation rules (`required`, `email`, `minLength`, etc.)\n- Validation properties (`$invalid`, `$dirty`, `$error`, `$errors`, `$pending`)\n- Displaying errors (`getErrors`, `flatErrors`)\n- Modifiers (`autoDirty`, `lazy`, `silent`, `rewardEarly`, `validationGroups`)\n- Custom rules (`createRule`, inline rules, async rules)\n- Rule wrappers (`withMessage`, `withParams`, `withAsync`, `withTooltip`)\n- Rule operators (`and`, `or`, `not`, `pipe`, `applyIf`)\n\n### `regle-advanced`\n\nAdvanced patterns:\n\n- Collections (`$each`, array validation)\n- Async validation (`$pending`, debouncing)\n- Server errors (`externalErrors`, dot-path errors)\n- Reset forms (`$reset` options)\n- Global configuration (`defineRegleConfig`, i18n)\n- Variants (`createVariant`, `narrowVariant`, discriminated unions)\n- Scoped validation (`useScopedRegle`, `useCollectScope`)\n- Merge multiple Regles (`mergeRegles`)\n- Object self validation (`$self`)\n- Schema libraries (`useRegleSchema` with Zod, Valibot, ArkType)\n- Standard Schema spec (`useRules`, `refineRules`, `InferInput`)\n\n### `regle-typescript`\n\nTypeScript integration:\n\n- Type-safe output (`$validate` return type, `InferSafeOutput`)\n- Typing rules (`inferRules`, `RegleComputedRules`)\n- Typing component props (`InferRegleRoot`, `RegleFieldStatus`)"
|
|
255
|
+
},
|
|
249
256
|
{
|
|
250
257
|
"id": "integrations-mcp-server",
|
|
251
258
|
"title": "Regle MCP server",
|
|
@@ -293,7 +300,7 @@ var docs_data_default = {
|
|
|
293
300
|
"title": "Installation",
|
|
294
301
|
"category": "introduction",
|
|
295
302
|
"path": "introduction/installation.md",
|
|
296
|
-
"content": "# Installation\n\n## Prerequisites\n\nRequired\n- [Vue](https://vuejs.org/) <span data-title=\"vue\"></span> `3.
|
|
303
|
+
"content": "# Installation\n\n## Prerequisites\n\nRequired\n- [Vue](https://vuejs.org/) <span data-title=\"vue\"></span> `3.4+`.\n- [Typescript](https://www.typescriptlang.org/) <span data-title=\"ee.ts\"></span> `5.1+`. \n - Compatible with plain javascript.\n- Text Editor with Vue syntax support.\n - [VSCode](https://code.visualstudio.com/) <span data-title=\".vscode\"></span> is recommended, along with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar).\n\nOptional\n- [Nuxt](https://nuxt.com/) <span data-title=\"nuxt\"></span> \n - Nuxt `3.2.0+`, and check docs for [Nuxt module](/integrations/nuxt)\n- [Pinia](https://pinia.vuejs.org/) <span data-title=\"pinia\"></span> \n - Pinia `2.2.5+`\n\nSchema libraries: [Docs](/integrations/schemas-libraries)\n\n- [Zod](https://zod.dev/) <span data-title=\"zod\"></span> `3.24+`. \n- [Valibot](https://valibot.dev/) <span data-title=\"valibot\"></span> `1+`.\n- [ArkType](https://arktype.io/) <span data-title=\"arktype\"></span> `2+`\n- Any library using the [Standard Schema Spec](https://standardschema.dev/) \n\n<br/>\n\n::: code-group\n\n```sh [pnpm]\npnpm add @regle/core @regle/rules\n```\n\n```sh [npm]\nnpm install @regle/core @regle/rules\n```\n\n```sh [yarn]\nyarn add @regle/core @regle/rules\n```\n\n```sh [bun]\nbun add @regle/core @regle/rules\n```\n\n:::\n\n## Devtools\n\nTo enable devtools, you need to install the Regle plugin in your app.\n\n:::tip\nIf you use the `@regle/nuxt` module, the devtools will be automatically enabled.\n:::\n\n```ts [main.ts]\nimport { createApp } from 'vue';\nimport { RegleVuePlugin } from '@regle/core';\nimport App from './App.vue';\n\nconst app = createApp(App);\n\napp.use(RegleVuePlugin); // <--\n\napp.mount('#app');\n```\n\nYou can provide options to the RegleVuePlugin to customize global config.\nSee [Global configuration](/advanced-usage/global-config#declarative) for more details.\n\n## MCP server\n\nRegle offers an MCP server that can be used to get documentation and autocomplete for Regle.\n\nYou can install it using the following configurations:\n\n- [Cursor](/integrations/mcp-server#cursor)\n- [Claude Desktop](/integrations/mcp-server#claude-desktop)"
|
|
297
304
|
},
|
|
298
305
|
{
|
|
299
306
|
"id": "introduction-migrate-from-vuelidate",
|
|
@@ -343,7 +350,7 @@ var docs_data_default = {
|
|
|
343
350
|
"description": "- The rule definition object containing:\n- `validator`: The validation function\n- `message`: Error message (string or function)\n- `type`: Optional rule type identifier\n- `active`: Optional function to conditionally activate the rule\n- `tooltip`: Optional tooltip message",
|
|
344
351
|
"optional": false
|
|
345
352
|
}],
|
|
346
|
-
"returnType": "InferRegleRule<TType, TValue, TParams, TAsync, TMetadata, TNonEmpty>",
|
|
353
|
+
"returnType": "InferRegleRule<TType, TValue, TParams, TAsync, TMetadata, TNonEmpty extends true ? true : false>",
|
|
347
354
|
"example": "import { createRule } from '@regle/core';\nimport { isFilled } from '@regle/rules';\n\n// Simple rule without params\nexport const isFoo = createRule({\n validator(value: Maybe<string>) {\n if (isFilled(value)) {\n return value === 'foo';\n }\n return true;\n },\n message: \"The value should be 'foo'\"\n});\n\n// Rule with parameters\nexport const minCustom = createRule({\n validator(value: Maybe<number>, min: number) {\n if (isFilled(value)) {\n return value >= min;\n }\n return true;\n },\n message: ({ $params: [min] }) => `Value must be at least ${min}`\n});\n\n// Usage\nuseRegle({ name: '' }, { name: { isFoo } });\nuseRegle({ count: 0 }, { count: { minCustom: minCustom(5) } });",
|
|
348
355
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/reusable-rules Documentation" }
|
|
349
356
|
},
|
|
@@ -394,10 +401,24 @@ var docs_data_default = {
|
|
|
394
401
|
"kind": "function",
|
|
395
402
|
"description": "Define a global Regle configuration to customize the validation behavior across your application.\n\nFeatures:\n- Customize built-in rules messages\n- Add your custom rules with full type inference\n- Define global modifiers (lazy, rewardEarly, etc.)\n- Define shortcuts for common validation patterns",
|
|
396
403
|
"parameters": [],
|
|
397
|
-
"returnType": "{\n useRegle: useRegleFn<TCustomRules, TShortcuts>;\n inferRules: inferRulesFn<TCustomRules
|
|
404
|
+
"returnType": "{\n useRegle: useRegleFn<Omit<TCustomRules, keyof DefaultValidators>, TShortcuts>;\n inferRules: inferRulesFn<Omit<TCustomRules, keyof DefaultValidators>>;\n useRules: useRulesFn<TCustomRules, TShortc...",
|
|
398
405
|
"example": "import { defineRegleConfig } from '@regle/core';\nimport { required, withMessage } from '@regle/rules';\n\nexport const { useRegle, inferRules, useRules } = defineRegleConfig({\n rules: () => ({\n // Override default required message\n required: withMessage(required, 'This field cannot be empty'),\n // Add custom rule\n myCustomRule: createRule({\n validator: (value) => value === 'valid',\n message: 'Invalid value'\n })\n }),\n modifiers: {\n lazy: true,\n rewardEarly: true\n }\n});",
|
|
399
406
|
"tags": { "see": "://reglejs.dev/advanced-usage/global-config Documentation" }
|
|
400
407
|
},
|
|
408
|
+
{
|
|
409
|
+
"name": "defineRegleOptions",
|
|
410
|
+
"kind": "function",
|
|
411
|
+
"description": "Define a global Regle options to customize the validation behavior across your application.\nIt's meant to be used with the Regle Vue plugin.",
|
|
412
|
+
"parameters": [{
|
|
413
|
+
"name": "options",
|
|
414
|
+
"type": "T",
|
|
415
|
+
"description": "- Configuration options",
|
|
416
|
+
"optional": false
|
|
417
|
+
}],
|
|
418
|
+
"returnType": "T",
|
|
419
|
+
"example": "import { defineRegleOptions } from '@regle/core';\n\nconst regleOptions = defineRegleOptions({\n modifiers: {\n lazy: true,\n rewardEarly: true\n }\n});",
|
|
420
|
+
"tags": { "see": "://reglejs.dev/advanced-usage/global-config Documentation" }
|
|
421
|
+
},
|
|
401
422
|
{
|
|
402
423
|
"name": "defineRules",
|
|
403
424
|
"kind": "function",
|
|
@@ -574,7 +595,7 @@ var docs_data_default = {
|
|
|
574
595
|
"optional": false
|
|
575
596
|
}
|
|
576
597
|
],
|
|
577
|
-
"returnType": "root is NarrowVariant<TRoot
|
|
598
|
+
"returnType": "root is NarrowVariant<NonNullable<TRoot>, TKey, TValue>",
|
|
578
599
|
"example": "import { narrowVariant } from '@regle/core';\n\nif (narrowVariant(r$, 'type', 'EMAIL')) {\n // TypeScript knows r$.email exists here\n r$.email.$value = 'user@example.com';\n}",
|
|
579
600
|
"tags": { "see": "://reglejs.dev/advanced-usage/variants Documentation" }
|
|
580
601
|
},
|
|
@@ -672,7 +693,7 @@ var docs_data_default = {
|
|
|
672
693
|
"description": "",
|
|
673
694
|
"optional": true
|
|
674
695
|
}],
|
|
675
|
-
"returnType": "NonNullable<TState> extends PrimitiveTypes ? Omit<RegleCommonStatus<PrimitiveTypes & TState & {}, TDecl>, \"$value\" | ... 2 more ... | \"$originalValue\"> &
|
|
696
|
+
"returnType": "NonNullable<TState> extends PrimitiveTypes ? Omit<RegleCommonStatus<PrimitiveTypes & TState & {}, TDecl>, \"$value\" | ... 2 more ... | \"$originalValue\"> & ... 4 more ... & StandardSchemaV1<...> : Maybe...",
|
|
676
697
|
"example": "import { useRules, type InferInput } from '@regle/core';\nimport { required, string, email } from '@regle/rules';\n\nconst r$ = useRules({\n name: { required, string },\n email: { required, email }\n});\n\n// State is automatically created and typed\nr$.$value.name // string | null\nr$.$value.email // string | null\n\n// Can be used with Standard Schema compatible libraries\nconst result = await r$['~standard'].validate({ name: '', email: '' });",
|
|
677
698
|
"tags": { "see": "://reglejs.dev/common-usage/standard-schema#userules Documentation" }
|
|
678
699
|
},
|
|
@@ -736,7 +757,7 @@ var docs_data_default = {
|
|
|
736
757
|
"description": "",
|
|
737
758
|
"optional": false
|
|
738
759
|
}],
|
|
739
|
-
"returnType": "RegleRuleDefinition<\"alpha\", string, [options?: CommonAlphaOptions], false, boolean, string, string,
|
|
760
|
+
"returnType": "RegleRuleDefinition<\"alpha\", string, [options?: CommonAlphaOptions], false, boolean, string, string, false>",
|
|
740
761
|
"example": "import { alpha } from '@regle/rules';\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n alpha,\n // or with symbols allowed\n alpha: alpha({ allowSymbols: true }),\n },\n})",
|
|
741
762
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#alpha Documentation" }
|
|
742
763
|
},
|
|
@@ -750,7 +771,7 @@ var docs_data_default = {
|
|
|
750
771
|
"description": "",
|
|
751
772
|
"optional": false
|
|
752
773
|
}],
|
|
753
|
-
"returnType": "RegleRuleDefinition<\"alphaNum\", string | number, [options?: CommonAlphaOptions], false, boolean, string, string | number,
|
|
774
|
+
"returnType": "RegleRuleDefinition<\"alphaNum\", string | number, [options?: CommonAlphaOptions], false, boolean, string, string | number, false>",
|
|
754
775
|
"example": "import { alphaNum } from '@regle/rules';\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n alphaNum,\n // or with symbols allowed\n alphaNum: alphaNum({ allowSymbols: true }),\n },\n})",
|
|
755
776
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#alphanum Documentation" }
|
|
756
777
|
},
|
|
@@ -848,7 +869,7 @@ var docs_data_default = {
|
|
|
848
869
|
"description": "",
|
|
849
870
|
"optional": false
|
|
850
871
|
}],
|
|
851
|
-
"returnType": "RegleRuleDefinition<\"between\", number, [min: number, max: number, options?: CommonComparisonOptions], false, boolean, number, number,
|
|
872
|
+
"returnType": "RegleRuleDefinition<\"between\", number, [min: number, max: number, options?: CommonComparisonOptions], false, boolean, number, number, false>",
|
|
852
873
|
"example": "import { between } from '@regle/rules';\n\nconst maxCount = ref(6);\n\nconst { r$ } = useRegle({ count: 0 }, {\n count: {\n between: between(1, 6),\n // or with reactive max\n between: between(1, maxCount, { allowEqual: false }),\n // or with getter\n between: between(() => maxCount.value, 10)\n },\n})",
|
|
853
874
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#between Documentation" }
|
|
854
875
|
},
|
|
@@ -880,7 +901,7 @@ var docs_data_default = {
|
|
|
880
901
|
"description": "",
|
|
881
902
|
"optional": false
|
|
882
903
|
}],
|
|
883
|
-
"returnType": "RegleRuleDefinition<\"contains\", string, [part: string], false, boolean, string, string,
|
|
904
|
+
"returnType": "RegleRuleDefinition<\"contains\", string, [part: string], false, boolean, string, string, false>",
|
|
884
905
|
"example": "import { contains } from '@regle/rules';\n\nconst { r$ } = useRegle({ bestLib: '' }, {\n bestLib: {\n contains: contains('regle')\n },\n})",
|
|
885
906
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#contains Documentation" }
|
|
886
907
|
},
|
|
@@ -931,7 +952,7 @@ var docs_data_default = {
|
|
|
931
952
|
"description": "",
|
|
932
953
|
"optional": false
|
|
933
954
|
}],
|
|
934
|
-
"returnType": "RegleRuleDefinition<\"dateBetween\", string | Date, [before: string | Date, after: string | Date, options?: CommonComparisonOptions], false, boolean, string | Date, string | Date,
|
|
955
|
+
"returnType": "RegleRuleDefinition<\"dateBetween\", string | Date, [before: string | Date, after: string | Date, options?: CommonComparisonOptions], false, boolean, string | Date, string | Date, false>",
|
|
935
956
|
"example": "import { dateBetween } from '@regle/rules';\n\nconst { r$ } = useRegle({ birthday: null as Date | null }, {\n birthday: {\n dateBetween: dateBetween(new Date(), new Date(2030, 3, 1)),\n // or with options\n dateBetween: dateBetween(new Date(), new Date(2030, 3, 1), { allowEqual: false }),\n },\n})",
|
|
936
957
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#datebetween Documentation" }
|
|
937
958
|
},
|
|
@@ -972,7 +993,7 @@ var docs_data_default = {
|
|
|
972
993
|
"description": "",
|
|
973
994
|
"optional": false
|
|
974
995
|
}],
|
|
975
|
-
"returnType": "RegleRuleDefinition<\"endsWith\", string, [part: string], false, boolean, string, string,
|
|
996
|
+
"returnType": "RegleRuleDefinition<\"endsWith\", string, [part: string], false, boolean, string, string, false>",
|
|
976
997
|
"example": "import { endsWith } from '@regle/rules';\n\nconst { r$ } = useRegle({ firstName: '' }, {\n firstName: { endsWith: endsWith('foo') },\n})",
|
|
977
998
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#endswith Documentation" }
|
|
978
999
|
},
|
|
@@ -986,7 +1007,7 @@ var docs_data_default = {
|
|
|
986
1007
|
"description": "",
|
|
987
1008
|
"optional": false
|
|
988
1009
|
}],
|
|
989
|
-
"returnType": "RegleRuleDefinition<\"exactDigits\", string | number, [count: number], false, boolean, unknown, string | number,
|
|
1010
|
+
"returnType": "RegleRuleDefinition<\"exactDigits\", string | number, [count: number], false, boolean, unknown, string | number, false>",
|
|
990
1011
|
"example": "import { exactDigits } from '@regle/rules';\n\nconst exactValue = ref(6);\n\nconst { r$ } = useRegle({ digits: '' }, {\n digits: {\n exactDigits: exactDigits(6),\n // or with reactive value\n exactDigits: exactDigits(exactValue),\n // or with getter\n exactDigits: exactDigits(() => exactValue.value)\n },\n})",
|
|
991
1012
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#exactdigits Documentation" }
|
|
992
1013
|
},
|
|
@@ -1000,7 +1021,7 @@ var docs_data_default = {
|
|
|
1000
1021
|
"description": "",
|
|
1001
1022
|
"optional": false
|
|
1002
1023
|
}],
|
|
1003
|
-
"returnType": "RegleRuleDefinition<\"exactLength\", string | any[] | Record<PropertyKey, any>, [count: number], false, boolean, unknown, string | any[] | Record<PropertyKey, any>,
|
|
1024
|
+
"returnType": "RegleRuleDefinition<\"exactLength\", string | any[] | Record<PropertyKey, any>, [count: number], false, boolean, unknown, string | any[] | Record<PropertyKey, any>, false>",
|
|
1004
1025
|
"example": "import { exactLength } from '@regle/rules';\n\nconst exactValue = ref(6);\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n exactLength: exactLength(6),\n // or with reactive value\n exactLength: exactLength(exactValue),\n // or with getter\n exactLength: exactLength(() => exactValue.value)\n },\n})",
|
|
1005
1026
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#exactlength Documentation" }
|
|
1006
1027
|
},
|
|
@@ -1014,7 +1035,7 @@ var docs_data_default = {
|
|
|
1014
1035
|
"description": "",
|
|
1015
1036
|
"optional": false
|
|
1016
1037
|
}],
|
|
1017
|
-
"returnType": "RegleRuleDefinition<\"exactValue\", number, [count: number], false, boolean, number, number,
|
|
1038
|
+
"returnType": "RegleRuleDefinition<\"exactValue\", number, [count: number], false, boolean, number, number, false>",
|
|
1018
1039
|
"example": "import { exactValue } from '@regle/rules';\n\nconst exactCount = ref(6);\n\nconst { r$ } = useRegle({ count: 0 }, {\n count: {\n exactValue: exactValue(6),\n // or with reactive value\n exactValue: exactValue(exactCount),\n // or with getter\n exactValue: exactValue(() => exactCount.value)\n },\n})",
|
|
1019
1040
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#exactvalue Documentation" }
|
|
1020
1041
|
},
|
|
@@ -1037,7 +1058,7 @@ var docs_data_default = {
|
|
|
1037
1058
|
"description": "",
|
|
1038
1059
|
"optional": false
|
|
1039
1060
|
}],
|
|
1040
|
-
"returnType": "RegleRuleDefinition<\"fileType\", File, [accept: readonly string[]], false, boolean, unknown, File,
|
|
1061
|
+
"returnType": "RegleRuleDefinition<\"fileType\", File, [accept: readonly string[]], false, boolean, unknown, File, false>",
|
|
1041
1062
|
"example": "import { type InferInput } from '@regle/core';\nimport { fileType } from '@regle/rules';\n\nconst {r$} = useRegle({ file: null as File | null }, {\n file: { fileType: fileType(['image/png', 'image/jpeg']) },\n})",
|
|
1042
1063
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#filetype Documentation" }
|
|
1043
1064
|
},
|
|
@@ -1083,7 +1104,7 @@ var docs_data_default = {
|
|
|
1083
1104
|
"description": "",
|
|
1084
1105
|
"optional": false
|
|
1085
1106
|
}],
|
|
1086
|
-
"returnType": "RegleRuleDefinition<\"httpUrl\", string, [options?: UrlOptions], false, boolean, unknown, string,
|
|
1107
|
+
"returnType": "RegleRuleDefinition<\"httpUrl\", string, [options?: UrlOptions], false, boolean, unknown, string, false>",
|
|
1087
1108
|
"example": "import { httpUrl } from '@regle/rules';\n\nconst { r$ } = useRegle({ bestUrl: '' }, {\n bestUrl: { httpUrl },\n // or to force https protocol\n bestUrl: { httpUrl: httpUrl({ protocol: /^https$/ }) },\n})",
|
|
1088
1109
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#httpurl Documentation" }
|
|
1089
1110
|
},
|
|
@@ -1222,7 +1243,7 @@ var docs_data_default = {
|
|
|
1222
1243
|
"description": "",
|
|
1223
1244
|
"optional": false
|
|
1224
1245
|
}],
|
|
1225
|
-
"returnType": "RegleRuleDefinition<\"macAddress\", string, [separator?: string], false, boolean, string, string,
|
|
1246
|
+
"returnType": "RegleRuleDefinition<\"macAddress\", string, [separator?: string], false, boolean, string, string, false>",
|
|
1226
1247
|
"example": "import { macAddress } from '@regle/rules';\n\nconst { r$ } = useRegle({ address: '' }, {\n address: {\n macAddress,\n // or with custom separator\n macAddress: macAddress('-')\n },\n})",
|
|
1227
1248
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#macaddress Documentation" }
|
|
1228
1249
|
},
|
|
@@ -1255,7 +1276,7 @@ var docs_data_default = {
|
|
|
1255
1276
|
"description": "",
|
|
1256
1277
|
"optional": false
|
|
1257
1278
|
}],
|
|
1258
|
-
"returnType": "RegleRuleDefinition<\"maxFileSize\", File, [maxSize: number], false, true | { $valid: boolean; fileSize: number; }, unknown, File,
|
|
1279
|
+
"returnType": "RegleRuleDefinition<\"maxFileSize\", File, [maxSize: number], false, true | { $valid: boolean; fileSize: number; }, unknown, File, false>",
|
|
1259
1280
|
"example": "import { type InferInput } from '@regle/core';\nimport { maxFileSize } from '@regle/rules';\n\nconst {r$} = useRegle({ file: null as File | null }, {\n file: { maxFileSize: maxFileSize(10_000_000) }, // 10 MB\n})",
|
|
1260
1281
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#maxfilesize Documentation" }
|
|
1261
1282
|
},
|
|
@@ -1269,7 +1290,7 @@ var docs_data_default = {
|
|
|
1269
1290
|
"description": "",
|
|
1270
1291
|
"optional": false
|
|
1271
1292
|
}],
|
|
1272
|
-
"returnType": "RegleRuleDefinition<\"maxLength\", string | any[] | Record<PropertyKey, any>, [max: number, options?: CommonComparisonOptions], false, boolean, unknown, string | any[] | Record<...>,
|
|
1293
|
+
"returnType": "RegleRuleDefinition<\"maxLength\", string | any[] | Record<PropertyKey, any>, [max: number, options?: CommonComparisonOptions], false, boolean, unknown, string | any[] | Record<...>, false>",
|
|
1273
1294
|
"example": "import { maxLength } from '@regle/rules';\n\nconst maxValue = ref(6);\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n maxLength: maxLength(6),\n // or with reactive value\n maxLength: maxLength(maxValue),\n // or with getter\n maxLength: maxLength(() => maxValue.value)\n },\n})",
|
|
1274
1295
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#maxlength Documentation" }
|
|
1275
1296
|
},
|
|
@@ -1283,7 +1304,7 @@ var docs_data_default = {
|
|
|
1283
1304
|
"description": "",
|
|
1284
1305
|
"optional": false
|
|
1285
1306
|
}],
|
|
1286
|
-
"returnType": "RegleRuleDefinition<\"maxValue\", string | number, [max: string | number, options?: CommonComparisonOptions], false, boolean, string | number, string | number,
|
|
1307
|
+
"returnType": "RegleRuleDefinition<\"maxValue\", string | number, [max: string | number, options?: CommonComparisonOptions], false, boolean, string | number, string | number, false>",
|
|
1287
1308
|
"example": "import { maxValue } from '@regle/rules';\n\nconst maxCount = ref(6);\n\nconst { r$ } = useRegle({ count: 0 }, {\n count: {\n maxValue: maxValue(6),\n // or with options\n maxValue: maxValue(maxCount, { allowEqual: false }),\n // or with getter\n maxValue: maxValue(() => maxCount.value)\n },\n})",
|
|
1288
1309
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#maxvalue Documentation" }
|
|
1289
1310
|
},
|
|
@@ -1297,7 +1318,7 @@ var docs_data_default = {
|
|
|
1297
1318
|
"description": "",
|
|
1298
1319
|
"optional": false
|
|
1299
1320
|
}],
|
|
1300
|
-
"returnType": "RegleRuleDefinition<\"minFileSize\", File, [minSize: number], false, true | { $valid: boolean; fileSize: number; }, unknown, File,
|
|
1321
|
+
"returnType": "RegleRuleDefinition<\"minFileSize\", File, [minSize: number], false, true | { $valid: boolean; fileSize: number; }, unknown, File, false>",
|
|
1301
1322
|
"example": "import { type InferInput } from '@regle/core';\nimport { minFileSize } from '@regle/rules';\n\nconst {r$} = useRegle({ file: null as File | null }, {\n file: { minFileSize: minFileSize(1_000_000) }, // 1 MB\n})",
|
|
1302
1323
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#minfilesize Documentation" }
|
|
1303
1324
|
},
|
|
@@ -1311,7 +1332,7 @@ var docs_data_default = {
|
|
|
1311
1332
|
"description": "",
|
|
1312
1333
|
"optional": false
|
|
1313
1334
|
}],
|
|
1314
|
-
"returnType": "RegleRuleDefinition<\"minLength\", string | any[] | Record<PropertyKey, any>, [min: number, options?: CommonComparisonOptions], false, boolean,
|
|
1335
|
+
"returnType": "RegleRuleDefinition<\"minLength\", string | any[] | Record<PropertyKey, any>, [min: number, options?: CommonComparisonOptions], false, boolean, string | any[] | Record<...>, string | ... 1 more ... | Re...",
|
|
1315
1336
|
"example": "import { minLength } from '@regle/rules';\n\nconst minValue = ref(6);\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n minLength: minLength(6),\n // or with reactive value\n minLength: minLength(minValue),\n // or with getter\n minLength: minLength(() => minValue.value)\n },\n})",
|
|
1316
1337
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#minlength Documentation" }
|
|
1317
1338
|
},
|
|
@@ -1325,7 +1346,7 @@ var docs_data_default = {
|
|
|
1325
1346
|
"description": "",
|
|
1326
1347
|
"optional": false
|
|
1327
1348
|
}],
|
|
1328
|
-
"returnType": "RegleRuleDefinition<\"minValue\", string | number, [min: string | number, options?: CommonComparisonOptions], false, boolean, string | number, string | number,
|
|
1349
|
+
"returnType": "RegleRuleDefinition<\"minValue\", string | number, [min: string | number, options?: CommonComparisonOptions], false, boolean, string | number, string | number, false>",
|
|
1329
1350
|
"example": "import { minValue } from '@regle/rules';\n\nconst minCount = ref(6);\n\nconst { r$ } = useRegle({ count: 0 }, {\n count: {\n minValue: minValue(6),\n // or with options\n minValue: minValue(minCount, { allowEqual: false }),\n // or with getter\n minValue: minValue(() => minCount.value)\n },\n})",
|
|
1330
1351
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#minvalue Documentation" }
|
|
1331
1352
|
},
|
|
@@ -1432,7 +1453,7 @@ var docs_data_default = {
|
|
|
1432
1453
|
"description": "",
|
|
1433
1454
|
"optional": false
|
|
1434
1455
|
}],
|
|
1435
|
-
"returnType": "RegleRuleDefinition<\"regex\", string | number, [regexp: RegExp | RegExp[]], false, boolean, string | number, string | number,
|
|
1456
|
+
"returnType": "RegleRuleDefinition<\"regex\", string | number, [regexp: RegExp | RegExp[]], false, boolean, string | number, string | number, false>",
|
|
1436
1457
|
"example": "import { regex } from '@regle/rules';\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n regex: regex(/^foo/),\n // or with multiple patterns\n regex: regex([/^bar/, /baz$/]),\n },\n})",
|
|
1437
1458
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#regex Documentation" }
|
|
1438
1459
|
},
|
|
@@ -1455,7 +1476,7 @@ var docs_data_default = {
|
|
|
1455
1476
|
"description": "",
|
|
1456
1477
|
"optional": false
|
|
1457
1478
|
}],
|
|
1458
|
-
"returnType": "RegleRuleDefinition<\"required\", unknown, [condition: boolean], false, boolean, unknown, unknown,
|
|
1479
|
+
"returnType": "RegleRuleDefinition<\"required\", unknown, [condition: boolean], false, boolean, unknown, unknown, false>",
|
|
1459
1480
|
"example": "import { requiredIf } from '@regle/rules';\n\nconst form = ref({ name: '', condition: false });\nconst conditionRef = ref(false);\n\nconst { r$ } = useRegle(form, {\n name: {\n required: requiredIf(() => form.value.condition),\n // or with a ref\n required: requiredIf(conditionRef),\n },\n})",
|
|
1460
1481
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#requiredif Documentation" }
|
|
1461
1482
|
},
|
|
@@ -1469,7 +1490,7 @@ var docs_data_default = {
|
|
|
1469
1490
|
"description": "",
|
|
1470
1491
|
"optional": false
|
|
1471
1492
|
}],
|
|
1472
|
-
"returnType": "RegleRuleDefinition<\"required\", unknown, [condition: boolean], false, boolean, unknown, unknown,
|
|
1493
|
+
"returnType": "RegleRuleDefinition<\"required\", unknown, [condition: boolean], false, boolean, unknown, unknown, false>",
|
|
1473
1494
|
"example": "import { requiredUnless } from '@regle/rules';\n\nconst form = ref({ name: '', condition: false });\nconst conditionRef = ref(false);\n\nconst { r$ } = useRegle(form, {\n name: {\n required: requiredUnless(() => form.value.condition),\n // or with a ref\n required: requiredUnless(conditionRef)\n },\n})",
|
|
1474
1495
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#requiredunless Documentation" }
|
|
1475
1496
|
},
|
|
@@ -1488,7 +1509,7 @@ var docs_data_default = {
|
|
|
1488
1509
|
"description": "- Optional name for the other field (used in error message)",
|
|
1489
1510
|
"optional": true
|
|
1490
1511
|
}],
|
|
1491
|
-
"returnType": "RegleRuleDefinition<\"sameAs\", TTarget, [target: TTarget, otherName?: string], false, boolean, TTarget extends infer M ? M : TTarget,
|
|
1512
|
+
"returnType": "RegleRuleDefinition<\"sameAs\", TTarget, [target: TTarget, otherName?: string], false, boolean, TTarget extends infer M ? M : TTarget, unknown, false>",
|
|
1492
1513
|
"example": "import { sameAs } from '@regle/rules';\n\nconst form = ref({\n password: '',\n confirmPassword: '',\n});\n\nconst { r$ } = useRegle(form, {\n confirmPassword: {\n sameAs: sameAs(() => form.value.password),\n }\n})",
|
|
1493
1514
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#sameas Documentation" }
|
|
1494
1515
|
},
|
|
@@ -1502,7 +1523,7 @@ var docs_data_default = {
|
|
|
1502
1523
|
"description": "",
|
|
1503
1524
|
"optional": false
|
|
1504
1525
|
}],
|
|
1505
|
-
"returnType": "RegleRuleDefinition<\"startsWith\", string, [part: string], false, boolean, string, string,
|
|
1526
|
+
"returnType": "RegleRuleDefinition<\"startsWith\", string, [part: string], false, boolean, string, string, false>",
|
|
1506
1527
|
"example": "import { startsWith } from '@regle/rules';\n\nconst { r$ } = useRegle({ bestLib: '' }, {\n bestLib: {\n startsWith: startsWith('regle')\n },\n})",
|
|
1507
1528
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#startswith Documentation" }
|
|
1508
1529
|
},
|
|
@@ -1571,7 +1592,7 @@ var docs_data_default = {
|
|
|
1571
1592
|
"description": "",
|
|
1572
1593
|
"optional": false
|
|
1573
1594
|
}],
|
|
1574
|
-
"returnType": "RegleRuleDefinition<\"url\", string, [options?: UrlOptions], false, boolean, unknown, string,
|
|
1595
|
+
"returnType": "RegleRuleDefinition<\"url\", string, [options?: UrlOptions], false, boolean, unknown, string, false>",
|
|
1575
1596
|
"example": "import { url } from '@regle/rules';\n\nconst { r$ } = useRegle({ bestUrl: '' }, {\n bestUrl: { url },\n // or with custom protocol validation\n bestUrl: { url: url({ protocol: /^https?$/ }) },\n})",
|
|
1576
1597
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/built-in-rules#url Documentation" }
|
|
1577
1598
|
},
|
|
@@ -1600,7 +1621,7 @@ var docs_data_default = {
|
|
|
1600
1621
|
"description": "The `withMessage` wrapper lets you associate an error message with a rule.\nPass your rule as the first argument and the error message as the second.",
|
|
1601
1622
|
"parameters": [{
|
|
1602
1623
|
"name": "rule",
|
|
1603
|
-
"type": "RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetadata>",
|
|
1624
|
+
"type": "RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetadata, TInput, TFilteredValue, TNonEmpty>",
|
|
1604
1625
|
"description": "- The rule to wrap (can be inline function or rule definition)",
|
|
1605
1626
|
"optional": false
|
|
1606
1627
|
}, {
|
|
@@ -1609,7 +1630,7 @@ var docs_data_default = {
|
|
|
1609
1630
|
"description": "- The error message (string or function returning a string)",
|
|
1610
1631
|
"optional": false
|
|
1611
1632
|
}],
|
|
1612
|
-
"returnType": "RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetadata>",
|
|
1633
|
+
"returnType": "RegleRuleWithParamsDefinition<TType, TValue, TParams, TAsync, TMetadata, TInput, TFilteredValue, TNonEmpty>",
|
|
1613
1634
|
"example": "import { withMessage } from '@regle/rules';\n\nconst { r$ } = useRegle({ name: '' }, {\n name: {\n // With a static message\n customRule1: withMessage((value) => !!value, \"Custom Error\"),\n // With dynamic message using metadata\n customRule2: withMessage(\n customRuleInlineWithMetaData,\n ({ $value, foo }) => `Custom Error: ${$value} ${foo}`\n ),\n }\n})",
|
|
1614
1635
|
"tags": { "see": "://reglejs.dev/core-concepts/rules/rule-wrappers#withmessage Documentation" }
|
|
1615
1636
|
},
|
|
@@ -1934,7 +1955,7 @@ function searchApi(query) {
|
|
|
1934
1955
|
return results;
|
|
1935
1956
|
}
|
|
1936
1957
|
|
|
1937
|
-
var version = "1.
|
|
1958
|
+
var version = "1.19.0-beta.1";
|
|
1938
1959
|
|
|
1939
1960
|
let posthogClient = null;
|
|
1940
1961
|
posthogClient = new PostHog("phc_kqgJoylCpKkGkkRGxb4MyN2mViehoQcUFEGwVkk4l8E", {
|