Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Populate Some Param Descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Mar 26, 2023
1 parent 454eef8 commit e76a0b6
Show file tree
Hide file tree
Showing 126 changed files with 537 additions and 451 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
"resources/core/**": false,
"CONTRIBUTING.md": true
},
"css.lint.unknownProperties": "ignore"
"css.lint.unknownProperties": "ignore",
"docify.commentService.docstringFormat": "JsDoc",
"docify.commentService.programmingLanguage": "javascript"
}
2 changes: 1 addition & 1 deletion scripts/documentation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const files = glob.sync(join(docsPath, '/**/*.md'));
*
* @param {string} somePath
* @param {Array<string>} args
* @return {*}
* @return {void}
*/
function join(somePath, ...args) {
return path.join(somePath, ...args).replace(/\\/gm, '/');
Expand Down
6 changes: 3 additions & 3 deletions scripts/streamer/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class StreamerServer {
* @static
* @param {number} id
* @param {{ key: string; range: number }} data
* @return {*}
* @return {void}
* @memberof StreamerServer
*/ static updateRange(id, data) {
if (!data) {
Expand Down Expand Up @@ -136,8 +136,8 @@ class StreamerServer {
}
return Math.sqrt(
Math.pow(vector1.x - vector2.x, 2) +
Math.pow(vector1.y - vector2.y, 2) +
Math.pow(vector1.z - vector2.z, 2),
Math.pow(vector1.y - vector2.y, 2) +
Math.pow(vector1.z - vector2.z, 2),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/streamer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class StreamerServer {
* @static
* @param {number} id
* @param {{ key: string; range: number }} data
* @return {*}
* @return {void}
* @memberof StreamerServer
*/
static updateRange(id: number, data: { key: string; range: number }) {
Expand Down
8 changes: 4 additions & 4 deletions src-webviews/src/utility/webViewEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class InternalFunctions {
* Initializes `alt.on` forwarders.
*
* @static
* @return {*}
* @return {void}
* @memberof InternalFunctions
*/
static init() {
Expand All @@ -24,7 +24,7 @@ class InternalFunctions {
* @static
* @param {string} eventName
* @param {...any[]} args
* @return {*}
* @return {void}
* @memberof InternalFunctions
*/
static handleEmits(eventName: string, ...args: any[]) {
Expand All @@ -42,7 +42,7 @@ export default class WebViewEvents {
* Closes the WebView page.
*
* @static
* @return {*}
* @return {void}
* @memberof WebViewEvents
*/
static emitClose() {
Expand All @@ -59,7 +59,7 @@ export default class WebViewEvents {
*
* @static
* @param {string} pageName
* @return {*}
* @return {void}
* @memberof WebViewEvents
*/
static emitReady(pageName: string, ...args: any[]) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/camera/cinematic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const InternalFunctions = {
/**
* Check if the camera is currently moving between nodes.
*
* @return {*}
* @return {void}
* @memberof InternalFunctions
*/
async isCameraUpdating() {
Expand All @@ -123,7 +123,7 @@ const InternalFunctions = {

/**
* Create a camera at the given position
* @param {alt.IVector3} pos - The position of the camera.
* @param {iCameraNode} node
*/
async next(node: iCameraNode): Promise<void> {
if (!node) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/camera/gameplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Internal = {
* Disable the gameplay camera from moving
*
* @export
* @return {*}
* @return {void}
*/
export function disable() {
if (typeof interval !== 'undefined') {
Expand All @@ -33,7 +33,7 @@ export function disable() {
* Enable the gameplay camera
*
* @export
* @return {*}
* @return {void}
*/
export function enable() {
if (typeof interval === 'undefined') {
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/camera/pedEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function create(_scriptID: number, offset: alt.IVector3 = null, _is
* Calculates a camera offset.
* @static
* @param {Vector3} offset
* @return {*} {Vector3}
* @return {void} {Vector3}
* @memberof PedEditCamera
*/
export function calculateCamOffset(offset: alt.IVector3): alt.IVector3 {
Expand Down Expand Up @@ -104,7 +104,7 @@ export function setCameraOffset(offset: alt.IVector3) {
/**
* Check if a PedEditCamera exists.
* @static
* @return {*}
* @return {void}
* @memberof PedEditCamera
*/
export function exists() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/menus/npc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function addInjection(callback: NpcMenuInjection) {
*
* @static
* @param {number} scriptID
* @return {*}
* @return {void}
* @memberof NpcWheelMenu
*/
export function open(scriptID: number): void {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/menus/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function addInjection(callback: ObjectMenuInjection): void {
*
* @static
* @param {CreatedObject} scriptID
* @return {*}
* @return {void}
* @memberof ObjectWheelMenu
*/
export function open(object: CreatedObject): void {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/menus/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function addInjection(callback: PlayerMenuInjection) {
* Opens the wheel menu against a target player.
*
* @param {alt.Player} target
* @return {*}
* @return {void}
* @memberof PlayerWheelMenu
*/
export function open(target: alt.Player) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/menus/vehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export function addInjection(callback: VehicleMenuInjection) {
* Open an in-vehicle menu option and add injections relevant to in-vehicle.
*
* @static
* @param {alt.Vehicle} vehicle
* @return {*}
* @param {alt.Vehicle} vehicle An alt:V Vehicle Entity
* @return {void}
* @memberof VehicleWheelMenu
*/
export function openInVehicleMenu(vehicle: alt.Vehicle) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/rmlui/menu3d/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const InternalFunctions = {
/**
* Create an in-world 3D menu with maximum options.
*
* @param {alt.IVector3} pos
* @param {alt.IVector3} pos A position in the world.
* @param {Array<OptionFor3DMenu>} options
* @param {number} maxDistance
* @return {void}
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/rmlui/progressbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ const ProgressBarConst = {
/**
* Remove a progress bar early.
*
* @param {string} uid
* @return {*}
* @param {string} uid A unique string
* @return {void}
*/
remove(uid: string) {
const index = InternalFunctions.getIndexOfElement(uid);
Expand Down
10 changes: 5 additions & 5 deletions src/core/client/rmlui/sprites/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const InternalFunctions = {
/**
* Get the index of the image we want to modify.
*
* @param {string} uid
* @param {string} uid A unique string
* @return {number}
*/
getIndexOfElement(uid: string): number {
Expand All @@ -91,7 +91,7 @@ const InternalFunctions = {
/**
* Create the rml element if it does not exist.
*
* @param {string} uid
* @param {string} uid A unique string
*/
createElement(uid: string) {
const index = InternalFunctions.getIndexOfElement(uid);
Expand All @@ -111,7 +111,7 @@ const InternalFunctions = {
/**
* Remove the rml element if it exists.
*
* @param {string} uid
* @param {string} uid A unique string
*/
removeElement(uid: string) {
const index = InternalFunctions.getIndexOfElement(uid);
Expand Down Expand Up @@ -241,7 +241,7 @@ export function create(sprite: SpriteInfo) {
/**
* Remove a sprite by `uid` and stop it from updating entirely.
*
* @param {string} uid
* @param {string} uid A unique string
*/
export function remove(uid: string) {
const index = InternalFunctions.getIndexOfElement(uid);
Expand All @@ -257,7 +257,7 @@ export function remove(uid: string) {
* Use this to update position of the sprite dynamically.
* Requires the `uid` specified to update it.
*
* @param {string} uid
* @param {string} uid A unique string
* @param {Partial<Sprite>} sprite
*/
export function update(uid: string, sprite: Partial<SpriteInfo>) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/rmlui/staticText/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const InternalFunctions = {
* Create in-world static text.
* If the same uid is used it will simply replace the object.
*
* @param {alt.IVector3} pos
* @param {alt.IVector3} pos A position in the world.
* @param {Array<OptionFor3DMenu>} options
* @param {number} maxDistance
* @return {void}
Expand Down Expand Up @@ -116,7 +116,7 @@ export function upsert(drawable: StaticTextInfo): void {
* Remove static text based on uid.
* Marks for deletion, and then removes it.
*
* @param {string} uid
* @param {string} uid A unique string
*/
export function remove(uid: string) {
if (!drawables.has(uid)) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/screen/credits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function clear() {
* Creates on-screen text that looks like the GTA:V credits.
*
* @param {ICredit} credit
* @return {*}
* @return {void}
*/
export async function create(credit: ICredit) {
clear();
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/screen/marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const zeroVector = { x: 0, y: 0, z: 0 };
/**
* Draw a marker in an every tick.
* @param {number} type
* @param {alt.IVector3} pos
* @param {alt.IVector3} pos A position in the world.
* @param {alt.IVector3} scale
* @param {alt.RGBA} color
* @param {boolean} bobUpAndDown
Expand Down
8 changes: 4 additions & 4 deletions src/core/client/screen/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function getHeight(asPercent = false): number {
* Get the Top Left of the MiniMap
* @static
* @param {boolean} [asPercent=false] Convert to percentage?
* @return {*}
* @return {void}
* @memberof Minimap
*/
export function getTopLeft(asPercent = false): alt.IVector2 {
Expand All @@ -64,7 +64,7 @@ export function getTopLeft(asPercent = false): alt.IVector2 {
* Get the top right of the MiniMap
* @static
* @param {boolean} [asPercent=false] Convert to percentage?
* @return {*}
* @return {void}
* @memberof Minimap
*/
export function getTopRight(asPercent = false): alt.IVector2 {
Expand All @@ -84,7 +84,7 @@ export function getTopRight(asPercent = false): alt.IVector2 {
* Get bottom left of the MiniMap
* @static
* @param {boolean} [asPercent=false] Convert to percentage?
* @return {*}
* @return {void}
* @memberof Minimap
*/
export function getBottomLeft(asPercent = false): alt.IVector2 {
Expand All @@ -104,7 +104,7 @@ export function getBottomLeft(asPercent = false): alt.IVector2 {
* Get Bottom Right of MiniMap
* @static
* @param {boolean} [asPercent=false] Conver to percentage?
* @return {*}
* @return {void}
* @memberof Minimap
*/
export function getBottomRight(asPercent = false): alt.IVector2 {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/screen/progressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function create(progressBar: ProgressBar) {

/**
* `removeBar` removes a bar from the `bars` array.
* @param {string} uid - The unique identifier of the bar.
* @param {string} uid A unique string - The unique identifier of the bar.
* @returns The function that is being returned is the function that is being called.
*/
export function remove(uid: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/screen/screenText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function getWidth(text: string, font: number, scale: number): number {
* @static
* @param {number} size
* @param {number} scale
* @return {*}
* @return {void}
* @memberof ScreenText
*/
export function getHeight(scale: number, font: number): number {
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/screen/shard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function clear() {
*
* @export
* @param {IShard} shard
* @return {*}
* @return {void}
*/
export async function create(shard: IShard) {
await clear();
Expand Down
6 changes: 3 additions & 3 deletions src/core/client/screen/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export function drawText2D(
* Draw a box at a 3D coordinate
*
* @export
* @param {alt.IVector3} pos
* @param {alt.IVector3} pos A position in the world.
* @param {alt.IVector2} size
* @param {alt.RGBA} color
* @return {*}
* @return {void}
*/
export function drawRectangle(pos: alt.IVector3, size: alt.IVector2, color: alt.RGBA) {
const [isOnScreen, x, y] = native.getScreenCoordFromWorldCoord(pos.x, pos.y, pos.z, 0, 0);
Expand Down Expand Up @@ -141,7 +141,7 @@ export function addTemporaryText(identifier, msg, x, y, scale, r, g, b, a, ms) {
/**
* Stop drawing temporary text based on the name.
* @param {*} identifier
* @return {*}
* @return {void}
*/
function removeText(identifier: string): void {
const index = temporaryText.findIndex((data) => data.identifier === identifier);
Expand Down
4 changes: 2 additions & 2 deletions src/core/client/screen/texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const textureData = {};
* @param {alt.IVector2} position
* @param {number} [scale=1]
* @param {number} [opacity=255]
* @return {*}
* @return {void}
*/
export function drawTexture2D(
dictionary: string,
Expand Down Expand Up @@ -69,7 +69,7 @@ export function drawTexture2D(
* @param {string} name
* @param {alt.Vector3} position
* @param {number} [scale=1]
* @return {*}
* @return {void}
*/
export function drawTexture(dictionary: string, name: string, position: alt.Vector3, scale: number = 1) {
if (!native.hasStreamedTextureDictLoaded(dictionary)) {
Expand Down
Loading

0 comments on commit e76a0b6

Please sign in to comment.