Skip to content
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

Native type declarations #974

Open
Felipellira opened this issue Jan 6, 2024 · 1 comment
Open

Native type declarations #974

Felipellira opened this issue Jan 6, 2024 · 1 comment

Comments

@Felipellira
Copy link

Felipellira commented Jan 6, 2024

The packages:

https://www.npmjs.com/package/@citizenfx/client
https://www.npmjs.com/package/@citizenfx/server

aren't open source, so i can't contribute to fix some declarations

to be more precise the native DrawMarker should accept some parameters value as NULL but it's only accepting strings

textureDict: A texture dictionary to draw the marker with, or NULL. Example: 'GolfPutting'
textureName: A texture name in textureDict to draw the marker with, or NULL. Example: 'PuttingMarker'

Current declaration

declare function DrawMarker(_type: number, posX: number, posY: number, posZ: number, dirX: number, dirY: number, dirZ: number, rotX: number, rotY: number, rotZ: number, scaleX: number, scaleY: number, scaleZ: number, red: number, green: number, blue: number, alpha: number, bobUpAndDown: boolean, faceCamera: boolean, p19: number, rotate: boolean, textureDict: string, textureName: string, drawOnEnts: boolean): void;

Correct declaration

declare function DrawMarker(_type: number, posX: number, posY: number, posZ: number, dirX: number, dirY: number, dirZ: number, rotX: number, rotY: number, rotZ: number, scaleX: number, scaleY: number, scaleZ: number, red: number, green: number, blue: number, alpha: number, bobUpAndDown: boolean, faceCamera: boolean, p19: number, rotate: boolean, textureDict: string | null, textureName: string | null, drawOnEnts: boolean): void;

@Felipellira Felipellira changed the title Javascript type packages Native type declarations Jan 6, 2024
@Disquse
Copy link
Contributor

Disquse commented Jan 6, 2024

These NPM packages are generated automatically from the data in this repo. You can pass empty strings instead of nulls, it should work in the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants