-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add TypeScript types and tests (#116)
Closes #96
- Loading branch information
1 parent
5e9b68f
commit 9b9da32
Showing
6 changed files
with
1,711 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { FunctionalComponentOptions } from 'vue'; | ||
|
||
export interface ClientOnlyProps { | ||
placeholder?: string; | ||
placeholderTag?: string; | ||
} | ||
|
||
declare const ClientOnly: FunctionalComponentOptions<ClientOnlyProps>; | ||
|
||
export default ClientOnly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { expectType } from 'tsd'; | ||
import { CreateElement, Component, FunctionalComponentOptions } from 'vue'; | ||
import ClientOnly, { ClientOnlyProps } from 'vue-client-only'; | ||
|
||
const createElement: CreateElement = null as unknown as CreateElement; | ||
|
||
createElement(ClientOnly); | ||
|
||
expectType<Component>(ClientOnly); | ||
expectType<FunctionalComponentOptions>(ClientOnly); | ||
expectType<FunctionalComponentOptions<ClientOnlyProps>>(ClientOnly); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6" | ||
], | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"noEmit": true, | ||
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index". | ||
// If the library is global (cannot be imported via `import` or `require`), leave this out. | ||
"baseUrl": ".", | ||
"paths": { | ||
"vue-client-only": [ | ||
"." | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.