ziggy-js 2.3.0 → 2.4.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/README.md +11 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -4
- package/src/js/index.d.ts +21 -9
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ Add the `@routes` Blade directive to your main layout (_before_ your application
|
|
|
44
44
|
|
|
45
45
|
### `route()` function
|
|
46
46
|
|
|
47
|
-
Ziggy's `route()` function works like [Laravel's `route()` helper](https://laravel.com/docs/
|
|
47
|
+
Ziggy's `route()` function works like [Laravel's `route()` helper](https://laravel.com/docs/helpers#method-route)—you can pass it the name of a route, and the parameters you want to pass to the route, and it will generate a URL.
|
|
48
48
|
|
|
49
49
|
#### Basic usage
|
|
50
50
|
|
|
@@ -378,6 +378,16 @@ Now you can use the `route()` function anywhere in your Vue components and templ
|
|
|
378
378
|
<a class="nav-link" :href="route('home')">Home</a>
|
|
379
379
|
```
|
|
380
380
|
|
|
381
|
+
With `<script setup>` in Vue 3 you can use `inject` to make the `route()` function available in your component script:
|
|
382
|
+
|
|
383
|
+
```vue
|
|
384
|
+
<script setup>
|
|
385
|
+
import { inject } from 'vue';
|
|
386
|
+
|
|
387
|
+
const route = inject('route');
|
|
388
|
+
</script>
|
|
389
|
+
```
|
|
390
|
+
|
|
381
391
|
If you are not using the `@routes` Blade directive, import Ziggy's configuration too and pass it to `.use()`:
|
|
382
392
|
|
|
383
393
|
```js
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as r,stringify as t}from"qs";function n(
|
|
1
|
+
import{parse as r,stringify as t}from"qs";function n(r,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,a(e.key),e)}}function e(r,t,e){return t&&n(r.prototype,t),e&&n(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function i(){return i=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(r[e]=n[e])}return r},i.apply(null,arguments)}function u(r){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},u(r)}function o(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(o=function(){return!!r})()}function f(r,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},f(r,t)}function a(r){var t=function(r){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(r);return"symbol"==typeof t?t:t+""}function c(r){var t="function"==typeof Map?new Map:void 0;return c=function(r){if(null===r||!function(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(t){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return function(r,t,n){if(o())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var i=new(r.bind.apply(r,e));return n&&f(i,n.prototype),i}(r,arguments,u(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,r)},c(r)}var s=/*#__PURE__*/function(){function t(r,t,n){var e,i;this.name=r,this.definition=t,this.bindings=null!=(e=t.bindings)?e:{},this.wheres=null!=(i=t.wheres)?i:{},this.config=n}var n=t.prototype;return n.matchesUrl=function(t){var n,e=this;if(!this.definition.methods.includes("GET"))return!1;var i=this.template.replace(/[.*+$()[\]]/g,"\\$&").replace(/(\/?){([^}?]*)(\??)}/g,function(r,t,n,i){var u,o="(?<"+n+">"+((null==(u=e.wheres[n])?void 0:u.replace(/(^\^)|(\$$)/g,""))||"[^/?]+")+")";return i?"("+t+o+")?":""+t+o}).replace(/^\w+:\/\//,""),u=t.replace(/^\w+:\/\//,"").split("?"),o=u[0],f=u[1],a=null!=(n=new RegExp("^"+i+"/?$").exec(o))?n:new RegExp("^"+i+"/?$").exec(decodeURI(o));if(a){for(var c in a.groups)a.groups[c]="string"==typeof a.groups[c]?decodeURIComponent(a.groups[c]):a.groups[c];return{params:a.groups,query:r(f)}}return!1},n.compile=function(r){var t=this;return this.parameterSegments.length?this.template.replace(/{([^}?]+)(\??)}/g,function(n,e,i){var u,o;if(!i&&[null,void 0].includes(r[e]))throw new Error("Ziggy error: '"+e+"' parameter is required for route '"+t.name+"'.");if(t.wheres[e]&&!new RegExp("^"+(i?"("+t.wheres[e]+")?":t.wheres[e])+"$").test(null!=(o=r[e])?o:""))throw new Error("Ziggy error: '"+e+"' parameter '"+r[e]+"' does not match required format '"+t.wheres[e]+"' for route '"+t.name+"'.");return encodeURI(null!=(u=r[e])?u:"").replace(/%7C/g,"|").replace(/%25/g,"%").replace(/\$/g,"%24")}).replace(this.config.absolute?/(\.[^/]+?)(\/\/)/:/(^)(\/\/)/,"$1/").replace(/\/+$/,""):this.template},e(t,[{key:"template",get:function(){var r=(this.origin+"/"+this.definition.uri).replace(/\/+$/,"");return""===r?"/":r}},{key:"origin",get:function(){return this.config.absolute?this.definition.domain?""+this.config.url.match(/^\w+:\/\//)[0]+this.definition.domain+(this.config.port?":"+this.config.port:""):this.config.url:""}},{key:"parameterSegments",get:function(){var r,t;return null!=(r=null==(t=this.template.match(/{[^}?]+\??}/g))?void 0:t.map(function(r){return{name:r.replace(/{|\??}/g,""),required:!/\?}$/.test(r)}}))?r:[]}}])}(),l=/*#__PURE__*/function(r){function n(t,n,e,u){var o;if(void 0===e&&(e=!0),(o=r.call(this)||this).t=null!=u?u:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,o.t=i({},o.t,{absolute:e}),t){if(!o.t.routes[t])throw new Error("Ziggy error: route '"+t+"' is not in the route list.");o.i=new s(t,o.t.routes[t],o.t),o.u=o.o(n)}return o}var u,o;o=r,(u=n).prototype=Object.create(o.prototype),u.prototype.constructor=u,f(u,o);var a=n.prototype;return a.toString=function(){var r=this,n=Object.keys(this.u).filter(function(t){return!r.i.parameterSegments.some(function(r){return r.name===t})}).filter(function(r){return"_query"!==r}).reduce(function(t,n){var e;return i({},t,((e={})[n]=r.u[n],e))},{});return this.i.compile(this.u)+t(i({},n,this.u._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:function(r,t){return"boolean"==typeof r?Number(r):t(r)}})},a.l=function(r){var t=this;r?this.t.absolute&&r.startsWith("/")&&(r=this.v().host+r):r=this.h();var n={},e=Object.entries(this.t.routes).find(function(e){return n=new s(e[0],e[1],t.t).matchesUrl(r)})||[void 0,void 0];return i({name:e[0]},n,{route:e[1]})},a.h=function(){var r=this.v(),t=r.pathname,n=r.search;return(this.t.absolute?r.host+t:t.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"))+n},a.current=function(r,t){var n=this.l(),e=n.name,u=n.params,o=n.query,f=n.route;if(!r)return e;var a=new RegExp("^"+r.replace(/\./g,"\\.").replace(/\*/g,".*")+"$").test(e);if([null,void 0].includes(t)||!a)return a;var c=new s(e,f,this.t);t=this.o(t,c);var l=i({},u,o);if(Object.values(t).every(function(r){return!r})&&!Object.values(l).some(function(r){return void 0!==r}))return!0;var v=function(r,t){return Object.entries(r).every(function(r){var n=r[0],e=r[1];return Array.isArray(e)&&Array.isArray(t[n])?e.every(function(r){return t[n].includes(r)}):"object"==typeof e&&"object"==typeof t[n]&&null!==e&&null!==t[n]?v(e,t[n]):t[n]==e})};return v(t,l)},a.v=function(){var r,t,n,e,i,u,o="undefined"!=typeof window?window.location:{},f=o.host,a=o.pathname,c=o.search;return{host:null!=(r=null==(t=this.t.location)?void 0:t.host)?r:void 0===f?"":f,pathname:null!=(n=null==(e=this.t.location)?void 0:e.pathname)?n:void 0===a?"":a,search:null!=(i=null==(u=this.t.location)?void 0:u.search)?i:void 0===c?"":c}},a.has=function(r){return this.t.routes.hasOwnProperty(r)},a.o=function(r,t){var n=this;void 0===r&&(r={}),void 0===t&&(t=this.i),null!=r||(r={}),r=["string","number"].includes(typeof r)?[r]:r;var e=t.parameterSegments.filter(function(r){return!n.t.defaults[r.name]});if(Array.isArray(r))r=r.reduce(function(r,t,n){var u,o;return i({},r,e[n]?((u={})[e[n].name]=t,u):"object"==typeof t?t:((o={})[t]="",o))},{});else if(1===e.length&&!r[e[0].name]&&(r.hasOwnProperty(Object.values(t.bindings)[0])||r.hasOwnProperty("id"))){var u;(u={})[e[0].name]=r,r=u}return i({},this.p(t),this.m(r,t))},a.p=function(r){var t=this;return r.parameterSegments.filter(function(r){return t.t.defaults[r.name]}).reduce(function(r,n,e){var u,o=n.name;return i({},r,((u={})[o]=t.t.defaults[o],u))},{})},a.m=function(r,t){var n=t.bindings,e=t.parameterSegments;return Object.entries(r).reduce(function(r,t){var u,o,f=t[0],a=t[1];if(!a||"object"!=typeof a||Array.isArray(a)||!e.some(function(r){return r.name===f}))return i({},r,((o={})[f]=a,o));if(!a.hasOwnProperty(n[f])){if(!a.hasOwnProperty("id"))throw new Error("Ziggy error: object passed as '"+f+"' parameter is missing route model binding key '"+n[f]+"'.");n[f]="id"}return i({},r,((u={})[f]=a[n[f]],u))},{})},a.valueOf=function(){return this.toString()},e(n,[{key:"params",get:function(){var r=this.l();return i({},r.params,r.query)}},{key:"routeParams",get:function(){return this.l().params}},{key:"queryParams",get:function(){return this.l().query}}])}(/*#__PURE__*/c(String));function v(r,t,n,e){var i=new l(r,t,n,e);return r?i.toString():i}var h={install:function(r,t){var n=function(r,n,e,i){return void 0===i&&(i=t),v(r,n,e,i)};parseInt(r.version)>2?(r.config.globalProperties.route=n,r.provide("route",n)):r.mixin({methods:{route:n}})}};function g(r){if(!r&&!globalThis.Ziggy&&"undefined"==typeof Ziggy)throw new Error("Ziggy error: missing configuration. Ensure that a `Ziggy` variable is defined globally or pass a config object into the useRoute hook.");return function(t,n,e,i){return void 0===i&&(i=r),v(t,n,e,i)}}export{h as ZiggyVue,v as route,g as useRoute};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parse as t,stringify as r}from"qs";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)
|
|
1
|
+
import{parse as t,stringify as r}from"qs";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},e.apply(null,arguments)}class i{constructor(t,r,e){var i,n;this.name=t,this.definition=r,this.bindings=null!=(i=r.bindings)?i:{},this.wheres=null!=(n=r.wheres)?n:{},this.config=e}get template(){const t=`${this.origin}/${this.definition.uri}`.replace(/\/+$/,"");return""===t?"/":t}get origin(){return this.config.absolute?this.definition.domain?`${this.config.url.match(/^\w+:\/\//)[0]}${this.definition.domain}${this.config.port?`:${this.config.port}`:""}`:this.config.url:""}get parameterSegments(){var t,r;return null!=(t=null==(r=this.template.match(/{[^}?]+\??}/g))?void 0:r.map(t=>({name:t.replace(/{|\??}/g,""),required:!/\?}$/.test(t)})))?t:[]}matchesUrl(r){var e;if(!this.definition.methods.includes("GET"))return!1;const i=this.template.replace(/[.*+$()[\]]/g,"\\$&").replace(/(\/?){([^}?]*)(\??)}/g,(t,r,e,i)=>{var n;const s=`(?<${e}>${(null==(n=this.wheres[e])?void 0:n.replace(/(^\^)|(\$$)/g,""))||"[^/?]+"})`;return i?`(${r}${s})?`:`${r}${s}`}).replace(/^\w+:\/\//,""),[n,s]=r.replace(/^\w+:\/\//,"").split("?"),o=null!=(e=new RegExp(`^${i}/?$`).exec(n))?e:new RegExp(`^${i}/?$`).exec(decodeURI(n));if(o){for(const t in o.groups)o.groups[t]="string"==typeof o.groups[t]?decodeURIComponent(o.groups[t]):o.groups[t];return{params:o.groups,query:t(s)}}return!1}compile(t){return this.parameterSegments.length?this.template.replace(/{([^}?]+)(\??)}/g,(r,e,i)=>{var n,s;if(!i&&[null,void 0].includes(t[e]))throw new Error(`Ziggy error: '${e}' parameter is required for route '${this.name}'.`);if(this.wheres[e]&&!new RegExp(`^${i?`(${this.wheres[e]})?`:this.wheres[e]}$`).test(null!=(s=t[e])?s:""))throw new Error(`Ziggy error: '${e}' parameter '${t[e]}' does not match required format '${this.wheres[e]}' for route '${this.name}'.`);return encodeURI(null!=(n=t[e])?n:"").replace(/%7C/g,"|").replace(/%25/g,"%").replace(/\$/g,"%24")}).replace(this.config.absolute?/(\.[^/]+?)(\/\/)/:/(^)(\/\/)/,"$1/").replace(/\/+$/,""):this.template}}class n extends String{constructor(t,r,n=!0,s){if(super(),this.t=null!=s?s:"undefined"!=typeof Ziggy?Ziggy:null==globalThis?void 0:globalThis.Ziggy,this.t=e({},this.t,{absolute:n}),t){if(!this.t.routes[t])throw new Error(`Ziggy error: route '${t}' is not in the route list.`);this.i=new i(t,this.t.routes[t],this.t),this.o=this.u(r)}}toString(){const t=Object.keys(this.o).filter(t=>!this.i.parameterSegments.some(({name:r})=>r===t)).filter(t=>"_query"!==t).reduce((t,r)=>e({},t,{[r]:this.o[r]}),{});return this.i.compile(this.o)+r(e({},t,this.o._query),{addQueryPrefix:!0,arrayFormat:"indices",encodeValuesOnly:!0,skipNulls:!0,encoder:(t,r)=>"boolean"==typeof t?Number(t):r(t)})}h(t){t?this.t.absolute&&t.startsWith("/")&&(t=this.l().host+t):t=this.m();let r={};const[n,s]=Object.entries(this.t.routes).find(([e,n])=>r=new i(e,n,this.t).matchesUrl(t))||[void 0,void 0];return e({name:n},r,{route:s})}m(){const{host:t,pathname:r,search:e}=this.l();return(this.t.absolute?t+r:r.replace(this.t.url.replace(/^\w*:\/\/[^/]+/,""),"").replace(/^\/+/,"/"))+e}current(t,r){const{name:n,params:s,query:o,route:u}=this.h();if(!t)return n;const h=new RegExp(`^${t.replace(/\./g,"\\.").replace(/\*/g,".*")}$`).test(n);if([null,void 0].includes(r)||!h)return h;const a=new i(n,u,this.t);r=this.u(r,a);const l=e({},s,o);if(Object.values(r).every(t=>!t)&&!Object.values(l).some(t=>void 0!==t))return!0;const c=(t,r)=>Object.entries(t).every(([t,e])=>Array.isArray(e)&&Array.isArray(r[t])?e.every(e=>r[t].includes(e)):"object"==typeof e&&"object"==typeof r[t]&&null!==e&&null!==r[t]?c(e,r[t]):r[t]==e);return c(r,l)}l(){var t,r,e,i,n,s;const{host:o="",pathname:u="",search:h=""}="undefined"!=typeof window?window.location:{};return{host:null!=(t=null==(r=this.t.location)?void 0:r.host)?t:o,pathname:null!=(e=null==(i=this.t.location)?void 0:i.pathname)?e:u,search:null!=(n=null==(s=this.t.location)?void 0:s.search)?n:h}}get params(){const{params:t,query:r}=this.h();return e({},t,r)}get routeParams(){return this.h().params}get queryParams(){return this.h().query}has(t){return this.t.routes.hasOwnProperty(t)}u(t={},r=this.i){null!=t||(t={}),t=["string","number"].includes(typeof t)?[t]:t;const i=r.parameterSegments.filter(({name:t})=>!this.t.defaults[t]);return Array.isArray(t)?t=t.reduce((t,r,n)=>e({},t,i[n]?{[i[n].name]:r}:"object"==typeof r?r:{[r]:""}),{}):1!==i.length||t[i[0].name]||!t.hasOwnProperty(Object.values(r.bindings)[0])&&!t.hasOwnProperty("id")||(t={[i[0].name]:t}),e({},this.$(r),this.p(t,r))}$(t){return t.parameterSegments.filter(({name:t})=>this.t.defaults[t]).reduce((t,{name:r},i)=>e({},t,{[r]:this.t.defaults[r]}),{})}p(t,{bindings:r,parameterSegments:i}){return Object.entries(t).reduce((t,[n,s])=>{if(!s||"object"!=typeof s||Array.isArray(s)||!i.some(({name:t})=>t===n))return e({},t,{[n]:s});if(!s.hasOwnProperty(r[n])){if(!s.hasOwnProperty("id"))throw new Error(`Ziggy error: object passed as '${n}' parameter is missing route model binding key '${r[n]}'.`);r[n]="id"}return e({},t,{[n]:s[r[n]]})},{})}valueOf(){return this.toString()}}function s(t,r,e,i){const s=new n(t,r,e,i);return t?s.toString():s}const o={install(t,r){const e=(t,e,i,n=r)=>s(t,e,i,n);parseInt(t.version)>2?(t.config.globalProperties.route=e,t.provide("route",e)):t.mixin({methods:{route:e}})}};function u(t){if(!t&&!globalThis.Ziggy&&"undefined"==typeof Ziggy)throw new Error("Ziggy error: missing configuration. Ensure that a `Ziggy` variable is defined globally or pass a config object into the useRoute hook.");return(r,e,i,n=t)=>s(r,e,i,n)}export{o as ZiggyVue,s as route,u as useRoute};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziggy-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Use your Laravel named routes in JavaScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"laravel",
|
|
@@ -56,11 +56,12 @@
|
|
|
56
56
|
"qs": "~6.9.7"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"
|
|
59
|
+
"@types/qs": "^6.9.17",
|
|
60
|
+
"jsdom": "^25.0.1",
|
|
60
61
|
"microbundle": "^0.15.1",
|
|
61
62
|
"prettier": "^3.3.3",
|
|
62
|
-
"typescript": "^5.
|
|
63
|
-
"vitest": "^2.
|
|
63
|
+
"typescript": "^5.6.3",
|
|
64
|
+
"vitest": "^2.1.4"
|
|
64
65
|
},
|
|
65
66
|
"prettier": {
|
|
66
67
|
"printWidth": 100,
|
package/src/js/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ParsedQs } from 'qs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A list of routes and their parameters and bindings.
|
|
3
5
|
*
|
|
@@ -5,6 +7,11 @@
|
|
|
5
7
|
*/
|
|
6
8
|
export interface RouteList {}
|
|
7
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Marker interface to configure Ziggy's type checking behavior.
|
|
12
|
+
*/
|
|
13
|
+
export interface TypeConfig {}
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* A route name registered with Ziggy.
|
|
10
17
|
*/
|
|
@@ -13,7 +20,9 @@ type KnownRouteName = keyof RouteList;
|
|
|
13
20
|
/**
|
|
14
21
|
* A route name, or any string.
|
|
15
22
|
*/
|
|
16
|
-
type RouteName =
|
|
23
|
+
type RouteName = TypeConfig extends { strictRouteNames: true }
|
|
24
|
+
? KnownRouteName
|
|
25
|
+
: KnownRouteName | (string & {});
|
|
17
26
|
// `(string & {})` prevents TypeScript from reducing this type to just `string`,
|
|
18
27
|
// which would prevent intellisense from autocompleting known route names.
|
|
19
28
|
// See https://stackoverflow.com/a/61048124/6484459.
|
|
@@ -159,7 +168,7 @@ interface Router {
|
|
|
159
168
|
current<T extends RouteName>(name: T, params?: ParameterValue | RouteParams<T>): boolean;
|
|
160
169
|
get params(): Record<string, string>;
|
|
161
170
|
get routeParams(): Record<string, string>;
|
|
162
|
-
get queryParams():
|
|
171
|
+
get queryParams(): ParsedQs;
|
|
163
172
|
has<T extends RouteName>(name: T): boolean;
|
|
164
173
|
}
|
|
165
174
|
|
|
@@ -168,6 +177,15 @@ interface Router {
|
|
|
168
177
|
*/
|
|
169
178
|
// Called with no arguments - returns a Router instance
|
|
170
179
|
export function route(): Router;
|
|
180
|
+
|
|
181
|
+
// Called with configuration arguments only - returns a configured Router instance
|
|
182
|
+
export function route(
|
|
183
|
+
name: undefined,
|
|
184
|
+
params: undefined,
|
|
185
|
+
absolute?: boolean,
|
|
186
|
+
config?: Config,
|
|
187
|
+
): Router;
|
|
188
|
+
|
|
171
189
|
// Called with a route name and optional additional arguments - returns a URL string
|
|
172
190
|
export function route<T extends RouteName>(
|
|
173
191
|
name: T,
|
|
@@ -175,19 +193,13 @@ export function route<T extends RouteName>(
|
|
|
175
193
|
absolute?: boolean,
|
|
176
194
|
config?: Config,
|
|
177
195
|
): string;
|
|
196
|
+
|
|
178
197
|
export function route<T extends RouteName>(
|
|
179
198
|
name: T,
|
|
180
199
|
params?: ParameterValue | undefined,
|
|
181
200
|
absolute?: boolean,
|
|
182
201
|
config?: Config,
|
|
183
202
|
): string;
|
|
184
|
-
// Called with configuration arguments only - returns a configured Router instance
|
|
185
|
-
export function route(
|
|
186
|
-
name: undefined,
|
|
187
|
-
params: undefined,
|
|
188
|
-
absolute?: boolean,
|
|
189
|
-
config?: Config,
|
|
190
|
-
): Router;
|
|
191
203
|
|
|
192
204
|
/**
|
|
193
205
|
* Ziggy's Vue plugin.
|