mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
Fix lint
This commit is contained in:
26
types/uinput/index.d.ts
vendored
26
types/uinput/index.d.ts
vendored
@@ -3,19 +3,21 @@
|
||||
// Definitions by: Florian Richter <https://github.com/Fidge123>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { WriteStream } from "fs";
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from "fs";
|
||||
|
||||
declare module "uinput" {
|
||||
interface ISetupOptions {
|
||||
interface SetupOptions {
|
||||
EV_KEY: any[];
|
||||
}
|
||||
|
||||
interface ICreateOptions {
|
||||
interface CreateOptions {
|
||||
name: string;
|
||||
id: ICreateID;
|
||||
id: CreateID;
|
||||
}
|
||||
|
||||
interface ICreateID {
|
||||
interface CreateID {
|
||||
bustype: number;
|
||||
vendor: number;
|
||||
product: number;
|
||||
@@ -28,28 +30,28 @@ declare module "uinput" {
|
||||
}
|
||||
|
||||
function setup(
|
||||
options: ISetupOptions,
|
||||
callback: (err: Error, stream: WriteStream) => void
|
||||
options: SetupOptions,
|
||||
callback: (err: Error, stream: fs.WriteStream) => void
|
||||
): void;
|
||||
function create(
|
||||
stream: WriteStream,
|
||||
options: ICreateOptions,
|
||||
stream: fs.WriteStream,
|
||||
options: CreateOptions,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
function send_event(
|
||||
stream: WriteStream,
|
||||
stream: fs.WriteStream,
|
||||
typeParam: number,
|
||||
code: number,
|
||||
value: number,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
function key_event(
|
||||
stream: WriteStream,
|
||||
stream: fs.WriteStream,
|
||||
code: number,
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
function emit_combo(
|
||||
stream: WriteStream,
|
||||
stream: fs.WriteStream,
|
||||
codes: number[],
|
||||
callback: (err: Error) => void
|
||||
): void;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
import * as fs from "fs";
|
||||
import * as uinput from 'uinput';
|
||||
import { WriteStream } from 'fs';
|
||||
|
||||
const setupOptions: uinput.ISetupOptions = {
|
||||
const setupOptions: uinput.SetupOptions = {
|
||||
EV_KEY: [uinput.KEY_A, uinput.KEY_B]
|
||||
};
|
||||
|
||||
const createID: uinput.ICreateID = {
|
||||
const createID: uinput.CreateID = {
|
||||
product: 123,
|
||||
vendor: 456,
|
||||
version: 789,
|
||||
bustype: uinput.BUS_VIRTUAL
|
||||
};
|
||||
|
||||
const createOptions: uinput.ICreateOptions = {
|
||||
const createOptions: uinput.CreateOptions = {
|
||||
id: createID,
|
||||
name: "TestDevice"
|
||||
};
|
||||
|
||||
uinput.setup(setupOptions, (err0: Error | undefined, stream: WriteStream): void => {
|
||||
uinput.setup(setupOptions, (err0: Error | undefined, stream: fs.WriteStream): void => {
|
||||
if (err0 instanceof Error) {
|
||||
throw err0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user