Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Oct 4, 2023
1 parent 7934b8f commit f7b245b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ route('authors.photos.show', [{ id: 1, name: 'Jacob' }, photo]);

#### TypeScript

> **This functionality is currently experimental.**
Ziggy includes TypeScript type definitions, and a helper command that can generate additional type definitions to enable route name and parameter autocompletion.

To generate the route types, run Ziggy's Artisan command with the `--types` or `--types-only` option:
Expand Down
2 changes: 1 addition & 1 deletion src/Output/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __toString(): string
});

return <<<JAVASCRIPT
/* This file is generated automatically! */
/* This file is generated by Ziggy. */
declare module 'ziggy-js' {
interface RouteList {$routes->toJson(JSON_PRETTY_PRINT)}
}
Expand Down
8 changes: 0 additions & 8 deletions src/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ interface Router {
has<T extends RouteName>(name: T): boolean,
}

// For the best autocomplete experience, the order of these function overloads *does* matter

/**
* Ziggy's route helper.
*/
Expand All @@ -163,9 +161,3 @@ export default function route(
absolute?: boolean,
config?: Config,
): Router;

// NOTES
// - The `route()` function above and the `RouteList` interface at the top of this file are the only
// exports - this is intentional. The implementation of the types inside this file is internal
// and experimental, and should be free to change as long as the externally visible behaviour
// stays the same.
2 changes: 1 addition & 1 deletion tests/fixtures/ziggy-7.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file is generated automatically! */
/* This file is generated by Ziggy. */
declare module 'ziggy-js' {
interface RouteList {
"posts.index": [],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/ziggy.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file is generated automatically! */
/* This file is generated by Ziggy. */
declare module 'ziggy-js' {
interface RouteList {
"posts.index": [],
Expand Down

0 comments on commit f7b245b

Please sign in to comment.