Skip to content

Commit

Permalink
ci: up
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Jun 27, 2024
1 parent ae927ff commit 40e3a77
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/win32-api/src/util/winspool/ClosePrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { HWND } from 'win32-def/types'
import { load, LibWinspool } from '##/lib/winspool/index.js'


const fnName: keyof LibWinspool = 'ClosePrinter'
const funcName: keyof LibWinspool = 'ClosePrinter'
// type RetType = ReturnType<FnType>
// type ParamType = Parameters<FnType>

Expand All @@ -16,7 +16,7 @@ const fnName: keyof LibWinspool = 'ClosePrinter'
export async function ClosePrinter(hwnd: HWND): Promise<boolean> {
assert(hwnd, 'hwnd must be a valid handle')

const lib = load([fnName])
const lib = load([funcName])
const res = await lib.ClosePrinter_Async(hwnd)
return !! res
}
Expand Down
4 changes: 2 additions & 2 deletions packages/win32-api/src/util/winspool/EnumPrinters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { load, LibWinspool } from '##/lib/winspool/index.js'
import type { EnumPrintersOptions } from './winspool.types.js'


const fnName: keyof LibWinspool = 'EnumPrintersW'
const funcName: keyof LibWinspool = 'EnumPrintersW'


/**
Expand All @@ -30,7 +30,7 @@ export async function EnumPrinters<Level extends EnumPrinters_Level>(

const level = options.Level

const lib = load([fnName])
const lib = load([funcName])

const name = ''
// assert(level >= 1 && level <= 5, 'level must be >= 1 and <= 5')
Expand Down
4 changes: 2 additions & 2 deletions packages/win32-api/src/util/winspool/GetDefaultPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { ucsBufferToString } from 'win32-def'
import { load, LibWinspool } from '##/lib/winspool/index.js'


const fnName: keyof LibWinspool = 'GetDefaultPrinterW'
const funcName: keyof LibWinspool = 'GetDefaultPrinterW'


/**
* @link https://learn.microsoft.com/en-us/windows/win32/printdocs/getdefaultprinter
*/
export async function GetDefaultPrinter(maxNameLength = 256): Promise<string> {
const lib = load([fnName])
const lib = load([funcName])

assert(maxNameLength > 2, 'maxNameLength must be greater than 2')

Expand Down
4 changes: 2 additions & 2 deletions packages/win32-api/src/util/winspool/GetPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { load, LibWinspool } from '##/lib/winspool/index.js'
import type { GetPrinterOptions } from './winspool.types.js'


const fnName: keyof LibWinspool = 'GetPrinterW'
const funcName: keyof LibWinspool = 'GetPrinterW'
// type RetType = ReturnType<FnType>
// type ParamType = Parameters<FnType>

Expand All @@ -16,7 +16,7 @@ const fnName: keyof LibWinspool = 'GetPrinterW'
export async function GetPrinter<Level extends PRINTER_INFO_LEVEL>(options: GetPrinterOptions<Level>): Promise<PRINTER_INFO_X_Type<Level>> {
const { hPrinter, Level, maxLength = 1024 } = options

const lib = load([fnName])
const lib = load([funcName])

const pPrinter = {} as PRINTER_INFO_X_Type<Level>
const cbBuf = (maxLength + 1) * 2
Expand Down
4 changes: 2 additions & 2 deletions packages/win32-api/src/util/winspool/OpenPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { HWND } from 'win32-def/types'
import { load, LibWinspool } from '##/lib/winspool/index.js'


const fnName: keyof LibWinspool = 'OpenPrinterW'
const funcName: keyof LibWinspool = 'OpenPrinterW'
// type RetType = ReturnType<FnType>
// type ParamType = Parameters<FnType>

Expand All @@ -18,7 +18,7 @@ const fnName: keyof LibWinspool = 'OpenPrinterW'
* @link https://learn.microsoft.com/zh-cn/windows/win32/printdocs/openprinter
*/
export async function OpenPrinter(printerName: string): Promise<HWND> {
const lib = load([fnName])
const lib = load([funcName])

const buf = Buffer.alloc(8)
const res = await lib.OpenPrinterW_Async(printerName, buf, null)
Expand Down

0 comments on commit 40e3a77

Please sign in to comment.