-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Compile Error #29
Comments
pls try this: import { K, U } from 'win32-api'
const knl32 = K.load()
const user32 = U.load()
export class WinAutomationService {
private knl32: typeof knl32;
private user32: typeof user32;
constructor() {
this.knl32 = knl32;
this.user32 = user32;
}
// ....
} AND this: const hWnd: HANDLE = this.user32.FindWindowExW(0, 0, null, lpszWindow); // wrong parameter order
const hWnd: HANDLE = this.user32.FindWindowExW(0, 0, lpszWindow, null); // correct |
I have the same problem. @BobbyShoe, did you find a solution? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I am getting this error when trying to use the win32-api in a typescript file and then compiling it with tsc.
"node_modules/win32-def/dist/lib/ffi.model.d.ts:26:18 - error TS2430: Interface 'FFIBuffer' incorrectly extends interface 'Buffer'.
The types of 'ref(...).readObject' are incompatible between these types.
Type '(offset?: number | undefined) => string' is not assignable to type '(buffer: Buffer, offset?: number | undefined) => Object'.
Types of parameters 'offset' and 'buffer' are incompatible.
Type 'Buffer' is not assignable to type 'number'.
26 export interface FFIBuffer extends Buffer {"
Below is my typescript class. I was basically just trying to run the sample to rename the calculator app. Any suggestions?
Thanks,
Bobby
import { FModel, K, U } from 'win32-api'
import { HANDLE } from 'win32-def/dist/lib/win.model';
export class WinAutomationService {
private knl32: FModel.ExpandFnModel<K.Win32Fns>;
private user32: FModel.ExpandFnModel<U.Win32Fns>;
}
Also here are all the node modules in my project if there happens to be a conflict here
+-- @electron-forge/[email protected]
+-- @electron-forge/[email protected]
+-- @electron-forge/[email protected]
+-- @electron-forge/[email protected]
+-- @electron-forge/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
The text was updated successfully, but these errors were encountered: