chore: add typescript examples
This commit is contained in:
parent
8076389b51
commit
077db6b73c
9 changed files with 859 additions and 2287 deletions
|
|
@ -13,6 +13,6 @@
|
|||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script src="src/index.js"></script>
|
||||
<script type="module" src="src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
"react-dom": "18.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"parcel": "2.0.0-beta.2"
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"parcel": "2.6.0",
|
||||
"typescript": "4.6.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ import { createRoot } from 'react-dom/client';
|
|||
|
||||
import App from './App';
|
||||
|
||||
const root = createRoot(document.getElementById('root'));
|
||||
const root = createRoot(document.getElementById('root')!);
|
||||
root.render(<App />);
|
||||
3
examples/demo/tsconfig.json
Normal file
3
examples/demo/tsconfig.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json"
|
||||
}
|
||||
|
|
@ -9,12 +9,12 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="container" id="app">
|
||||
<h1>DocSearch v3 - Vanilla JavaScript</h1>
|
||||
|
||||
<div id="docsearch"></div>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
<script type="module" src="app.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@docsearch/css": "3.1.0",
|
||||
"@docsearch/js": "3.1.0"
|
||||
"@docsearch/js": "3.1.0",
|
||||
"parcel": "2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"parcel": "2.0.0-beta.2"
|
||||
"typescript": "4.6.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue