Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Jun 30, 2024
1 parent 011121f commit 25a42c1
Show file tree
Hide file tree
Showing 54 changed files with 105 additions and 74 deletions.
3 changes: 2 additions & 1 deletion packages/win32-api/demo/GetCursorPos.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import assert from 'node:assert/strict'

import ffi from 'koffi'
import { registerFunction } from 'win32-api'
import { POINT_Factory, type POINT_Type } from 'win32-def/struct'
import { POINT_Factory } from 'win32-def/struct'
import type { POINT_Type } from 'win32-def/struct'


console.info('GetCursorPos()')
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/demo/show-hide-desktop.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import assert from 'node:assert/strict'
import { sleep } from '@waiting/shared-core'
import { User32 } from 'win32-api'
import { INPUT, KEYBDINPUT, VirtualKey } from 'win32-def/consts'
import { INPUT_Factory, type INPUT_Type } from 'win32-def/struct'
import { INPUT_Factory } from 'win32-def/struct'
import type { INPUT_Type } from 'win32-def/struct'


console.info('Show/hide desktop with Win+D shortcut')
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/comctl32/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type * as S from 'win32-def/struct'
import type * as T from 'win32-def/types'

import { type DefComctl32 } from './api.def.js'
import type { DefComctl32 } from './api.def.js'


export class Comctl32 implements T.LibDef2Type<typeof DefComctl32> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/comctl32/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/gdi32/api.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* c8 ignore start */
import type * as T from 'win32-def/types'

import { type DefGdi32 } from './api.def.js'
import type { DefGdi32 } from './api.def.js'


export class Gdi32 implements T.LibDef2Type<typeof DefGdi32> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/gdi32/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/kernel32/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type * as S from 'win32-def/struct'
import type * as T from 'win32-def/types'

import { type DefKernel32 } from './api.def.js'
import type { DefKernel32 } from './api.def.js'


export class Kernel32 implements T.LibDef2Type<typeof DefKernel32> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/kernel32/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/spoolss/api.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* c8 ignore start */
import type * as T from 'win32-def/types'

import { type DefSpoolss } from './api.def.js'
import type { DefSpoolss } from './api.def.js'


export class Spoolss implements T.LibDef2Type<typeof DefSpoolss> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/spoolss/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/user32/api.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* c8 ignore start */
import type * as T from 'win32-def/types'

import { type DefUser32 } from './api.def.js'
import type { DefUser32 } from './api.def.js'
import { User32Combo } from './dict/index.types.js'


Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/user32/dict/AB.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* c8 ignore start */
import type * as T from 'win32-def/types'

import { type DefUser32_B } from './AB.def.js'
import type { DefUser32_B } from './AB.def.js'


export class User32_B implements T.LibDef2Type<typeof DefUser32_B> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/user32/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/lib/winspool/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type * as S from 'win32-def/struct'
import type * as T from 'win32-def/types'

import { type DefWinspool } from './api.def.js'
import type { DefWinspool } from './api.def.js'


export class Winspool implements T.LibDef2Type<typeof DefWinspool> {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/lib/winspool/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type FLib, type LoadOptions, load as _load } from 'win32-def'
import { load as _load } from 'win32-def'
import type { FLib, LoadOptions } from 'win32-def'

import { DllNames } from '##/lib/types.js'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { FlattenNestedTuple } from '@waiting/shared-types'
import { getPRINTER_INFO_X_Ptr } from 'win32-def/struct'
import type { EnumPrinters_Level, MultipleChoiceMapper } from 'win32-def/types'

import { type DefWinspool } from '../api.def.js'
import type { DefWinspool } from '../api.def.js'
import type { Winspool } from '../api.types.js'


Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/user32/FindWindowEx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from 'assert'

import { type LibUser32, load } from '##/lib/user32/index.js'
import { load } from '##/lib/user32/index.js'
import type { LibUser32 } from '##/lib/user32/index.js'


const fnName: keyof LibUser32 = 'FindWindowExW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/user32/GetWindowText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import assert from 'assert'

import { ucsBufferToString } from 'win32-def'

import { type LibUser32, load } from '##/lib/user32/index.js'
import { load } from '##/lib/user32/index.js'
import type { LibUser32 } from '##/lib/user32/index.js'


const fnName: keyof LibUser32 = 'GetWindowTextW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/user32/MessageBox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from 'assert'

import { type LibUser32, load } from '##/lib/user32/index.js'
import { load } from '##/lib/user32/index.js'
import type { LibUser32 } from '##/lib/user32/index.js'


const fnName: keyof LibUser32 = 'MessageBoxExW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/ClosePrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import assert from 'node:assert'

import type { HWND } from 'win32-def/types'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'


const funcName: keyof LibWinspool = 'ClosePrinter'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/EndDocPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import assert from 'node:assert'

import type { HWND } from 'win32-def/types'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'


const funcName: keyof LibWinspool = 'EndDocPrinter'
Expand Down
8 changes: 5 additions & 3 deletions packages/win32-api/src/util/winspool/EnumPrinters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import assert from 'node:assert'
// must use ffi from 'win32-def'
import { ffi } from 'win32-def'
import {
type EnumPrinters_Level,
type EnumPrinters_Level_X_Type,


PRINTER_INFO_X_Factory,
getPRINTER_INFO_X_Ptr,
} from 'win32-def/struct'
import type { EnumPrinters_Level, EnumPrinters_Level_X_Type } from 'win32-def/struct'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'

import type { EnumPrintersOptions } from './winspool.types.js'

Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/GetDefaultPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import assert from 'node:assert'

import { ucsBufferToString } from 'win32-def'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'


const funcName: keyof LibWinspool = 'GetDefaultPrinterW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/GetPrinter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { PRINTER_INFO_LEVEL, PRINTER_INFO_X_Type } from 'win32-def/struct'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'

import type { GetPrinterOptions } from './winspool.types.js'

Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/OpenPrinter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HWND } from 'win32-def/types'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'


const funcName: keyof LibWinspool = 'OpenPrinterW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-api/src/util/winspool/StartDocPrinter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from 'node:assert'

import { load, type LibWinspool } from '##/lib/winspool/index.js'
import { load } from '##/lib/winspool/index.js'
import type { LibWinspool } from '##/lib/winspool/index.js'

import type { StartDocPrinterOptions } from './winspool.types.js'

Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/demo/show-hide-desktop.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import assert from 'node:assert/strict'
import { sleep } from '@waiting/shared-core'
import ffi from 'koffi'
import { INPUT, KEYBDINPUT, VirtualKey } from 'win32-def/consts'
import { INPUT_Factory, type INPUT_Type } from 'win32-def/struct'
import { INPUT_Factory } from 'win32-def/struct'
import type { INPUT_Type } from 'win32-def/struct'


console.info('Show/hide desktop with Win+D shortcut')
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/common.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// https://learn.microsoft.com/en-us/windows/win32/winprog64/the-new-data-types
// https://learn.microsoft.com/en-us/windows/win32/intl/windows-data-types-for-strings

import { type BigIntStr } from '@waiting/shared-types'
import type { BigIntStr } from '@waiting/shared-types'


export type _POINTER = Buffer
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// dict of windef value
import { CallingConvention } from './ffi.types.js'
import { type LoadOptions } from './types.js'
import type { LoadOptions } from './types.js'


export const config: Config = {
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/loader/def.helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'

import { type MethodTypeUnknown } from '@waiting/shared-types'
import type { MethodTypeUnknown } from '@waiting/shared-types'

import type {
FnDefFullParams,
Expand Down
8 changes: 2 additions & 6 deletions packages/win32-def/src/lib/loader/loader.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import koffi from 'koffi'

import { loadOptionsDefault } from '##/lib/config.js'
import { Def } from '##/lib/def.enum.js'
import {
type FuncDefListInner,
type FnDefArgs,
type FnDefFullParams,
CallingConvention,
} from '##/lib/ffi.types.js'
import { CallingConvention } from '##/lib/ffi.types.js'
import type { FuncDefListInner, FnDefArgs, FnDefFullParams } from '##/lib/ffi.types.js'
import { structFactoryMap } from '##/lib/struct/struct.factory-map.js'
import type {
FLib,
Expand Down
12 changes: 2 additions & 10 deletions packages/win32-def/src/lib/loader/loader.types.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
/* c8 ignore start */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { type AsyncMethodType, type MethodType } from '@waiting/shared-types'
import type { AsyncMethodType, MethodType } from '@waiting/shared-types'

import {
type FuncDefListInner,
type DllFuncsType,
type FnDefFullParams,
type FnDefRetType,
type FnDefParam,
type CallingConvention,
type FnDefCallParams,
} from '##/lib/ffi.types.js'
import type { FuncDefListInner, DllFuncsType, FnDefFullParams, FnDefRetType, FnDefParam, CallingConvention, FnDefCallParams } from '##/lib/ffi.types.js'
import type { IKoffiLib, FLib, LoadOptions, MultipleChoiceMapperList } from '##/lib/types.js'


Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/struct/struct.cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'

import { type StructDetail } from '##/lib/types.js'
import type { StructDetail } from '##/lib/types.js'


export class StructUnionCache {
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/src/lib/struct/wingdi/DEVMODEW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type * as T from '##/lib/common.types.js'
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genFixedInt16Array, genStruct } from '../struct.helper.js'
import { POINT_Factory, type POINT_Type } from '../windef/POINT.js'
import { POINT_Factory } from '../windef/POINT.js'
import type { POINT_Type } from '../windef/POINT.js'


const key = 'DEVMODEW'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/src/lib/struct/winspool/JOB_INFO_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as D from '##/lib/common.def.js'
import type * as T from '##/lib/common.types.js'
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { SYSTEMTIME_Factory, type SYSTEMTIME_Type } from '../minwinbase/SYSTEMTIME.js'
import { SYSTEMTIME_Factory } from '../minwinbase/SYSTEMTIME.js'
import type { SYSTEMTIME_Type } from '../minwinbase/SYSTEMTIME.js'
import { genStruct } from '../struct.helper.js'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type * as T from '##/lib/common.types.js'
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'
import { DEVMODEW_Factory, type DEVMODEW_Type } from '../wingdi/DEVMODEW.js'
import { DEVMODEW_Factory } from '../wingdi/DEVMODEW.js'
import type { DEVMODEW_Type } from '../wingdi/DEVMODEW.js'


const key = 'PRINTER_DEFAULTS'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as D from '##/lib/common.def.js'
import { type PRINTER_STATUS } from '##/lib/consts/index.consts.js'
import type { PRINTER_STATUS } from '##/lib/consts/index.consts.js'
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/src/lib/struct/winspool/PRINTER_INFO_8.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'
import { DEVMODEW_Factory, type DEVMODEW_Type } from '../wingdi/wingdi.index.js'
import { DEVMODEW_Factory } from '../wingdi/wingdi.index.js'
import type { DEVMODEW_Type } from '../wingdi/wingdi.index.js'


const key = 'PRINTER_INFO_8'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/src/lib/struct/winspool/PRINTER_INFO_9.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'
import { DEVMODEW_Factory, type DEVMODEW_Type } from '../wingdi/wingdi.index.js'
import { DEVMODEW_Factory } from '../wingdi/wingdi.index.js'
import type { DEVMODEW_Type } from '../wingdi/wingdi.index.js'


const key = 'PRINTER_INFO_9'
Expand Down
3 changes: 2 additions & 1 deletion packages/win32-def/src/lib/struct/winuser/ALTTABINFO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type * as T from '##/lib/common.types.js'
import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'
import { POINT_Factory, type POINT_Type } from '../windef/POINT.js'
import { POINT_Factory } from '../windef/POINT.js'
import type { POINT_Type } from '../windef/POINT.js'


const key = 'ALTTABINFO'
Expand Down
9 changes: 6 additions & 3 deletions packages/win32-def/src/lib/struct/winuser/INPUT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import type { StructFactoryResult, StructInitType } from '##/lib/types.js'

import { genStruct } from '../struct.helper.js'

import { HARDWAREINPUT_Factory, type HARDWAREINPUT_TYPE } from './HARDWAREINPUT.js'
import { KEYBDINPUT_Factory, type KEYBDINPUT_Type } from './KEYBDINPUT.js'
import { MOUSEINPUT_Factory, type MOUSEINPUT_Type } from './MOUSEINPUT.js'
import { HARDWAREINPUT_Factory } from './HARDWAREINPUT.js'
import type { HARDWAREINPUT_TYPE } from './HARDWAREINPUT.js'
import { KEYBDINPUT_Factory } from './KEYBDINPUT.js'
import type { KEYBDINPUT_Type } from './KEYBDINPUT.js'
import { MOUSEINPUT_Factory } from './MOUSEINPUT.js'
import type { MOUSEINPUT_Type } from './MOUSEINPUT.js'


const key = 'INPUT'
Expand Down
Loading

0 comments on commit 25a42c1

Please sign in to comment.