First commit
This commit is contained in:
commit
26e8760bc4
9 changed files with 120 additions and 0 deletions
16
.editorconfig
Normal file
16
.editorconfig
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Editor configuration, see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
/bazel-out
|
||||
|
||||
# Node
|
||||
**/node_modules
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
|
||||
# IDEs and editors
|
||||
.idea/
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
# System files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
playground/gxc-canvas-viewer/**/*.*
|
||||
19
.prettierignore
Normal file
19
.prettierignore
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
## file extensions
|
||||
*.*
|
||||
!*.scss
|
||||
!*.css
|
||||
!*.js
|
||||
!*.json
|
||||
!*.jsx
|
||||
!*.less
|
||||
!*.md
|
||||
!*.mdx
|
||||
!*.ts
|
||||
!*.tsx
|
||||
!*.yml
|
||||
|
||||
# ignore
|
||||
node_modules/**/*.*
|
||||
documentation/**/*.*
|
||||
dist/**/*.*
|
||||
coverage/**/*.*
|
||||
9
.prettierrc
Normal file
9
.prettierrc
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"bracketSpacing": true,
|
||||
"printWidth": 140,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"endOfLine": "auto"
|
||||
}
|
||||
0
README.md
Normal file
0
README.md
Normal file
1
lib/src/index.ts
Normal file
1
lib/src/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./interfaces";
|
||||
36
lib/src/interfaces/index.ts
Normal file
36
lib/src/interfaces/index.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
export type TRendererType = "2d" | "webgl" | "webgl2" | "webgpu" | "html";
|
||||
|
||||
export type DrawObjectType = "rectangle-object" | "image-object" | "ellipse-object" | "text-object";
|
||||
|
||||
export interface IDrawObject extends IDrawBorderedRectangle {
|
||||
readonly id: string;
|
||||
readonly type: DrawObjectType;
|
||||
color: string;
|
||||
}
|
||||
|
||||
export interface IDrawRectangle {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
angle: number;
|
||||
}
|
||||
|
||||
export interface IDrawBorderedRectangle extends IDrawRectangle {
|
||||
border: number;
|
||||
borderColor: string;
|
||||
}
|
||||
|
||||
export interface IScene {
|
||||
objects: IDrawObject[];
|
||||
selection?: IDrawRectangle;
|
||||
spotlight: IDrawRectangle[];
|
||||
background: string;
|
||||
static: IDrawObject[];
|
||||
}
|
||||
|
||||
export interface IRenderer {
|
||||
readonly type: TRendererType;
|
||||
holder: HTMLElement;
|
||||
render(scene: IScene): Promise<void>;
|
||||
}
|
||||
6
lib/src/package.json
Normal file
6
lib/src/package.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "@gxc-solutions/renderer-base",
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"author": "GXC Solutions"
|
||||
}
|
||||
0
package.json
Normal file
0
package.json
Normal file
Loading…
Add table
Add a link
Reference in a new issue