Skip to content

Commit

Permalink
Merge pull request #713 from tighten/fix-types
Browse files Browse the repository at this point in the history
Remove default export from type declarations
  • Loading branch information
bakerkretzmar authored Feb 20, 2024
2 parents 591ebdb + 829944a commit 9f282d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ interface Router {
* Ziggy's route helper.
*/
// Called with no arguments - returns a Router instance
export default function route(): Router;
export function route(): Router;
// Called with a route name and optional additional arguments - returns a URL string
export default function route<T extends RouteName>(
export function route<T extends RouteName>(
name: T,
params?: RouteParams<T> | undefined,
absolute?: boolean,
config?: Config,
): string;
// Called with configuration arguments only - returns a configured Router instance
export default function route(
export function route(
name: undefined,
params: undefined,
absolute?: boolean,
Expand Down
2 changes: 1 addition & 1 deletion tests/js/route.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertType } from 'vitest';
import route from '../../src/js';
import { route } from '../../src/js';

// Add generated routes to use for testing inside this file. In a real app these declarations
// would be in a separate file generated by running `php artisan ziggy:generate --types`.
Expand Down
2 changes: 1 addition & 1 deletion tests/js/route.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
import { route } from '../../src/js/index.js';
import { route } from '../../src/js';
// import { route } from '../../dist/index.esm.js';
// import { route } from '../../dist/index.js';
// import route from '../../dist/route.umd.js';
Expand Down

0 comments on commit 9f282d5

Please sign in to comment.