import PenClientParserV2 from "./PenClientParserV2"; import PenRequestV2 from "./PenRequestV2"; import Dot from "../API/Dot"; import { DotErrorInfo, VersionInfo } from "../Util/type"; type OnDot = (pencontroller: PenController, dot: Dot) => void; type OnMessage = (pencontroller: PenController, msgType: number, args: any) => void; type HandleWrite = (u8: Uint8Array) => void; export default class PenController { mParserV2: PenClientParserV2; mClientV2: PenRequestV2; mClientV1: any; onDot: OnDot | null; onMessage: OnMessage | null; handleWrite: HandleWrite | null; Protocol: number; info: VersionInfo; device: any; constructor(); /** * * * @param {callback} handledot * @param {callback} handlemessage * @memberof PenController */ addCallback(handledot: OnDot, handlemessage: OnMessage): void; addWrite(handlewrite: HandleWrite): void; /** * Step3 Send Data from Pen * @param {array} buff - uint8array */ putData(buff: Uint8Array): void; /** * 도트 에러 발생 시 메시지 출력을 위한 함수 * - 해당 함수가 기능하기 위해서는 onMessage를 구현해야 한다. * @param {any} args */ onErrorDetected(args: DotErrorInfo): void; localprocessSetRTCTime(): void; localProcessPenSettingInfo(): void; /** * 프로토콜 버전에 따라 펜에 요청하는 함수를 분기 실행하는 함수 * @param {any} requestV1 * @param {any} requestV2 * @returns */ Request(requestV1: any, requestV2: any): any; /** * 현재 버전을 요청하는 함수 * @returns */ RequestVersionInfo(): VersionInfo; /** * 펜에 설정된 비밀번호를 변경 요청하는 함수 * @param {string} oldone * @param {string} [newone=""] * @memberof PenController */ SetPassword(oldone: string, newone?: string): void; /** * 펜에 비밀번호를 전송하는 함수 * @param {string} password */ InputPassword(password: string): void; /** * 펜에 대한 각종 설정 확인을 요청하는 함수 */ RequestPenStatus(): void; /** * 펜 설정 중 시각을 변경 요청하는 함수 * - 1970년 1월 1일부터 millisecond tick (지금은 현재 시각으로 변경) */ SetRtcTime(): void; /** * 펜 설정 중 자동종료 시간을 변경 요청하는 함수 * 분 단위 (v2.17 = 5 ~ 3600 // v2.18 = 1 ~ 3600) * @param {number} minute */ SetAutoPowerOffTime(minute: number): void; /** * 펜 설정 중 펜 뚜껑을 닫을 경우 전원이 꺼지는 기능을 변경 요청하는 함수 * @param {boolean} enable - on / off */ SetPenCapPowerOnOffEnable(enable: boolean): void; /** * 펜 설정 중 펜 뚜껑 혹은 펜 필기 시 자동으로 전원이 켜지는 기능을 변경 요청하는 함수 * @param {boolean} enable - on / off */ SetAutoPowerOnEnable(enable: boolean): void; /** * 펜 설정 중 비프음 기능을 변경 요청하는 함수 * @param {boolean} enable - on / off */ SetBeepSoundEnable(enable: boolean): void; /** * 펜 설정 중 호버 모드 기능을 변경 요청하는 함수 * - 호버기능 : 펜의 위치를 penDown 전에 미리 가늠해 볼 수 있도록 시각적인 dot를 표시하는 기능 * @param {boolean} enable - on / off */ SetHoverEnable(enable: boolean): void; /** * 펜 설정 중 오프라인 저장 기능을 변경 요청하는 함수 * @param {boolean} enable - on / off */ SetOfflineDataEnable(enable: boolean): void; /** * 펜 설정 중 펜 LED 색을 변경 요청하는 함수 * @param {number} color - argb */ SetColor(color: number): void; /** * 펜 설정 중 펜의 필압 민감도를 변경 요청하는 함수 * - FSR 필압 센서가 달린 모델에서만 이용 * @param {number} step - 0 ~ 4 ( 0이 가장 민감 ) */ SetSensitivity(step: number): void; /** * 펜 설정 중 펜의 디스크를 초기화 요청하는 함수 */ RequestInitPenDisk(): void; /** * 펜의 실시간 필기 데이터에 대한 전송을 요청하는 함수 * @param {array} sections * @param {array} owners * @param {(array | null)}notes - null일 경우 노트를 구분하지 않는다. */ RequestAvailableNotes(sections: number[], owners: number[], notes: number[] | null): void; /** * 펜에 저장된 오프라인 필기 데이터의 종이 정보(note)를 요청하는 함수 * - section, owner 모두 0일 경우 저장된 모든 note ID 리스트 (최대 64개)를 요청한다. * @param {number} section * @param {number} owner */ RequestOfflineNoteList(section: number, owner: number): void; /** * 펜에 저장된 오프라인 필기 데이터의 종이 정보(page)를 요청하는 함수 * - section, owner, note 와 일치하는 하나의 노트의 page ID 리스트 (최대 128개)를 요청한다. * @param {number} section * @param {number} owner * @param {number} note */ RequestOfflinePageList(section: number, owner: number, note: number): void; /** * 펜에 저장된 오프라인 필기 데이터를 한 note ID 혹은 다수의 page ID로 요청하는 함수 * @param {number} section * @param {number} owner * @param {number} note * @param {boolean} deleteOnFinished - true일 경우 전송한 데이터 삭제, false일 경우 전송한 데이터 삭제 안함 * @param {array} pages - 빈 배열일 경우 노트 내 모든 page를 요청 * @returns */ RequestOfflineData(section: number, owner: number, note: number, deleteOnFinished?: boolean, pages?: any): any; /** * 펜에 저장된 오프라인 필기 데이터에 대한 삭제를 요청하는 함수 * - 노트 단위 삭제, 최대 64개 * @param {number} section * @param {number} owner * @param {array} notes */ RequestOfflineDelete(section: number, owner: number, notes: number[]): void; /** * 펜에 설치된 펌웨어를 업그레이드하기 위해 펜에게 질의하는 함수 * @param {File} file * @param {string} version * @param {boolean} isCompressed */ RequestFirmwareInstallation(file: File, version: string, isCompressed: boolean): void; /** * 펜에 펌웨어 데이터를 업로드하는 함수 * @param {number} offset * @param {Uint8Array} data * @param {number} status */ RequestFirmwareUpload(offset: number, data: Uint8Array, status: number): void; /** * 펜에 프로파일 생성을 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name * @param {string} password */ RequestProfileCreate: (name: string, password: string) => void; /** * 펜에 설정된 프로파일 제거를 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name * @param {string} password */ RequestProfileDelete: (name: string, password: string) => void; /** * 펜에 설정된 프로파일 정보를 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name */ RequestProfileInfo: (name: string) => void; /** * 펜에 설정된 프로파일 내 데이터 작성을 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name * @param {string} password * @param {Array} keys * @param {Array} data */ RequestProfileWriteValue: (name: string, password: string, data: { [key: string]: any; }) => void; /** * 펜에 설정된 프로파일 내 데이터 정보를 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name * @param {Array} keys */ RequestProfileReadValue: (name: string, keys: string[]) => void; /** * 펜에 설정된 프로파일 내 데이터 제거를 요청하는 함수 * - 프로파일은 네오랩을 통해 인증받은 뒤에 사용가능하기에, 현재는 고정값을 이용 * @param {string} name * @param {string} password * @param {Array} keys */ RequestProfileDeleteValue: (name: string, password: string, keys: string[]) => void; OnConnected(): void; OnDisconnected(): void; } export {};