Skip to content

Commit 2e2dac4

Browse files
Merge pull request #41 from AishwaryaSingh123950/aish/add-typescript-vite-example
Created typescript-vite example
2 parents 26dd42f + add2716 commit 2e2dac4

File tree

14 files changed

+1301
-0
lines changed

14 files changed

+1301
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/typescript-vite/LICENSE

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
The Nutrient Sample applications are licensed with a modified BSD
2+
license. In plain language: you're allowed to do whatever you wish
3+
with the code, modify, redistribute, embed in your products (free or
4+
commercial), but you must include copyright, terms of usage and
5+
disclaimer as stated in the license.
6+
7+
You will require a commercial Nutrient License to run these examples
8+
in non-demo mode. Please refer to [email protected] for details.
9+
10+
Copyright © 2017-present PSPDFKit GmbH.
11+
All rights reserved.
12+
13+
Redistribution and use in source or binary forms,
14+
with or without modification, are permitted provided
15+
that the following conditions are met:
16+
17+
- Redistributions of source code must retain the above copyright
18+
notice, this list of conditions and the following disclaimer.
19+
20+
- Redistributions in binary form must reproduce the above copyright
21+
notice, this list of conditions and the following disclaimer in the
22+
documentation and/or other materials provided with the
23+
distribution.
24+
25+
- Redistributions of Nutrient Samples must include attribution to
26+
Nutrient, either in documentation or other appropriate media.
27+
28+
- Neither the name of the Nutrient, PSPDFKit GmbH, nor its developers
29+
may be used to endorse or promote products derived from
30+
this software without specific prior written permission.
31+
32+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

examples/typescript-vite/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Nutrient Web SDK example – TypeScript + Vite
2+
3+
This example shows how to integrate [Nutrient for Web](https://www.nutrient.io/sdk/web/getting-started/typescript/) into a [TypeScript](https://www.typescriptlang.org/) app built with [Vite](https://vitejs.dev/).
4+
5+
## Prerequisites
6+
7+
- [Node.js](http://nodejs.org/)
8+
9+
## Getting started
10+
11+
Clone the repo:
12+
13+
```bash
14+
git clone https://github.com/PSPDFKit/nutrient-web-examples
15+
cd nutrient-web-examples/examples/typescript-vite
16+
```
17+
18+
Install the project dependencies:
19+
20+
```shell script
21+
npm install
22+
```
23+
24+
## Running the example
25+
26+
We are ready to launch the app! 🎉
27+
28+
```shell script
29+
npm run dev
30+
```
31+
32+
You can now open http://localhost:5173 in your browser and enjoy!
33+
34+
To create a production build of the app and serve it:
35+
36+
```shell script
37+
npm run build
38+
npm run preview
39+
```
40+
41+
You can now preview your build at http://localhost:4173 in your browser.
42+
43+
## TypeScript integration
44+
45+
This example demonstrates how to integrate Nutrient Web SDK in a TypeScript environment with correct type definitions. The integration can be found in the main TypeScript files in the `src/` directory.
46+
47+
## License
48+
49+
This software is licensed under a [modified BSD license](LICENSE).
50+
51+
## Contributing
52+
53+
Please ensure [you have signed our CLA](https://www.nutrient.io/guides/web/current/miscellaneous/contributing/) so that we can accept your contributions.
54+
55+
## Support, issues and license questions
56+
57+
Nutrient offers support for customers with an active SDK license via https://www.nutrient.io/support/request/
58+
59+
Are you [evaluating our SDK](https://www.nutrient.io/try/)? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://www.nutrient.io/sales/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Nutrient Web SDK viewer — TypeScript example</title>
8+
</head>
9+
<body>
10+
<script src="https://cdn.cloud.pspdfkit.com/[email protected]/nutrient-viewer.js"></script>
11+
<div class="container"></div>
12+
<script type="module" src="/src/main.ts"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)