-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not refer to typed-html in main decl
Closes #3
- Loading branch information
Showing
10 changed files
with
60 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Example | ||
|
||
A demo of library-agnostic type augmentation by typed-htmx. | ||
|
||
Try swapping out different `tsconfig.json`s to see the types of different libraries. |
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 |
---|---|---|
|
@@ -13,6 +13,6 @@ | |
"typed-htmx": "link:.." | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.2.15" | ||
"hono": "^3.11.12" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
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 @@ | ||
// typed-htmx declares mostly ambient types so this is all you need. | ||
import 'typed-htmx'; | ||
|
||
// A demo of how to augment foreign types with htmx attributes. | ||
// In this case, Hono sources its types from its own namespace, so we do the same | ||
// and directly extend its namespace. | ||
declare global { | ||
namespace Hono { | ||
interface HTMLAttributes extends HtmxAttributes {} | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
// This is (usually) the only setting to change when swapping renderers. | ||
"jsxImportSource": "hono/jsx" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
{ | ||
"files": ["index.jsx"], | ||
"compilerOptions": { | ||
"target": "es6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, | ||
// "jsx": "react", /* Specify what JSX code is generated. */ | ||
"jsx": "react-jsx" /* Specify what JSX code is generated. */, | ||
// "jsx": "react", | ||
"jsx": "react-jsx", /* Specify what JSX code is generated. */ | ||
// If your frontend framework prescribes a JSX source, change it here. | ||
// In this example, we will use typed-htmx's own text renderer based on typed-html. | ||
"jsxImportSource": "typed-htmx/typed-html", | ||
"module": "commonjs", | ||
"module": "node16", | ||
"moduleResolution": "node16" /* Specify how TypeScript looks up a file from a given module specifier. */, | ||
"types": ["typed-htmx"], | ||
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */, | ||
"checkJs": true /* Enable error reporting in type-checked JavaScript files. */, | ||
"noEmit": true, | ||
"rootDir": ".", | ||
"outDir": "./dist", | ||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, | ||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, | ||
"strict": true /* Enable all strict type-checking options. */, | ||
"skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */, | ||
"skipLibCheck": true /* Skip type checking all .d.ts files. */ | ||
} | ||
}, | ||
"include": [ | ||
"src/**/*", | ||
] | ||
} |
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