Skip to content

Commit

Permalink
docs(shared): add example for Symbols.serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
xxshady committed Aug 24, 2024
1 parent 2ca2cb9 commit c4ecabb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions types/shared/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3449,6 +3449,25 @@ declare module "@altv/shared" {
}

export namespace Symbols {
/**
* @example
* ```
* const myObj = {
* a: 1,
* b: 2,
* [alt.Symbols.serialize]: () => {
* return {
* c: myObj.a + myObj.b
* };
* }
* };
*
* alt.Events.on("testabc", (obj) => {
* alt.log(obj); // { c: 3 }
* });
* alt.Events.emit("testabc", myObj);
* ```
*/
export const serialize: unique symbol;
}

Expand Down

0 comments on commit c4ecabb

Please sign in to comment.