Base code and settings for cvat-canvas (#594)
parent
a2f1824c0d
commit
f341419f22
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"sourceType": "module",
|
||||||
|
"ecmaVersion": 6,
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"security",
|
||||||
|
"no-unsanitized",
|
||||||
|
"no-unsafe-innerhtml",
|
||||||
|
"@typescript-eslint",
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:security/recommended",
|
||||||
|
"plugin:no-unsanitized/DOM",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"airbnb",
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-new": [0],
|
||||||
|
"class-methods-use-this": [0],
|
||||||
|
"no-plusplus": [0],
|
||||||
|
"no-restricted-syntax": [0, {"selector": "ForOfStatement"}],
|
||||||
|
"no-continue": [0],
|
||||||
|
"security/detect-object-injection": 0,
|
||||||
|
"indent": ["warn", 4],
|
||||||
|
"no-useless-constructor": 0,
|
||||||
|
"func-names": [0],
|
||||||
|
"no-console": [0], // this rule deprecates console.log, console.warn etc. because "it is not good in production code"
|
||||||
|
"@typescript-eslint/no-explicit-any": [0],
|
||||||
|
},
|
||||||
|
};
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 129 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 303 KiB |
@ -1,5 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Intel Corporation
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
function tmp(message: string) {
|
/* eslint-disable */
|
||||||
console.log(message)
|
// Temporary disable eslint
|
||||||
return message;
|
|
||||||
|
interface CanvasInterface {
|
||||||
|
html(): HTMLElement;
|
||||||
|
setup(frameData: any, objectStates: any[]): void;
|
||||||
|
activate(clientID: number, attributeID?: number): void;
|
||||||
|
rotate(direction: Rotation): void;
|
||||||
|
focus(clientID: number, padding?: number): void;
|
||||||
|
fit(): void;
|
||||||
|
grid(stepX: number, stepY: number): void;
|
||||||
|
|
||||||
|
draw(shapeType: string, numberOfPoints: number, initialState: any): any;
|
||||||
|
split(enabled?: boolean): any;
|
||||||
|
group(enabled?: boolean): any;
|
||||||
|
merge(enabled?: boolean): any;
|
||||||
|
|
||||||
|
cancel(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Rotation {
|
||||||
|
CLOCKWISE90,
|
||||||
|
ANTICLOCKWISE90,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Canvas implements CanvasInterface {
|
||||||
|
public constructor() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public html(): HTMLElement {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public setup(frameData: any, objectStates: any[]): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public activate(clientID: number, attributeID: number = null): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public rotate(direction: Rotation): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public focus(clientID: number, padding: number = 0): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public fit(): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public grid(stepX: number, stepY: number): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public draw(shapeType: string, numberOfPoints: number, initialState: any): any {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public split(enabled: boolean = false): any {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public group(enabled: boolean = false): any {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public merge(enabled: boolean = false): any {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public cancel(): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue