Skip to content

Commit 419cf49

Browse files
authored
Add JSDocs and fix #19
1 parent 30a4df5 commit 419cf49

File tree

6 files changed

+29
-8
lines changed

6 files changed

+29
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: NPM
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
66

77
jobs:
88
publish:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Sean Boult and contributors
3+
Copyright (c) 2022 Sean Boult and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-skinview3d",
3-
"version": "3.0.1",
3+
"version": "3.1.0",
44
"description": "A React component for skinview3d Minecraft viewer",
55
"author": "Hacksore",
66
"license": "MIT",

rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ export default {
2525
},
2626
],
2727
external,
28-
plugins: [resolve(), typescript(), babel(), commonjs()],
28+
plugins: [resolve(), typescript({
29+
tsconfig: './tsconfig.json'
30+
}), babel(), commonjs()],
2931
};

src/index.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,30 @@ import * as skinview3d from "skinview3d";
55
// TODO: offscreen canvas support
66

77
interface ISkinview3d {
8-
className?: any; // TODO: type this
8+
/**
9+
* The class names to apply to the canvas
10+
*/
11+
className?: string,
12+
/**
13+
* The width of the canvas
14+
*/
915
width?: number;
16+
/**
17+
* The height of the canvas
18+
*/
1019
height?: number;
20+
/**
21+
* The skin to load in the canvas
22+
*/
1123
skinUrl?: string;
24+
/**
25+
* The cape to load in the cavas
26+
*/
1227
capeUrl?: string;
13-
onReady?: Function;
28+
/**
29+
* A function that is called when the skin viewer is ready
30+
*/
31+
onReady?: (skinview3d: skinview3d.SkinViewer) => void;
1432
}
1533

1634
const Skinview3d = ({

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4-
"declarationDir": "build",
4+
"declarationDir": "",
55
"module": "esnext",
66
"target": "es6",
77
"lib": ["es6", "dom", "es2016", "es2017"],
88
"sourceMap": true,
99
"jsx": "react",
10+
"outDir": "dist",
1011
"moduleResolution": "node",
1112
"allowSyntheticDefaultImports": true,
1213
"esModuleInterop": true
1314
},
14-
"include": ["src/**/*"],
15+
"include": ["src/index.tsx"],
1516
"exclude": ["node_modules", "build"]
1617
}

0 commit comments

Comments
 (0)