NextFire / apple-music-discord-rpc

🎵 Discord Rich Presence Client for the macOS Apple Music app and iTunes
MIT License
560 stars 37 forks source link

deno errors #13

Closed jrub1 closed 2 years ago

jrub1 commented 2 years ago

Hi, I just installed the script and am getting a bunch of deno errors I'm not sure how to address:


        "pointer", /* lpFileName */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:8:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpSecurityAttributes */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:11:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* hTemplateFile */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:14:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      result: "pointer",
      ~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:16:7

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* hNamedPipe */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:22:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpBuffer */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:23:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpBytesRead */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:25:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpTotalBytesAvail */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:26:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpBytesLeftThisMessage */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:27:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:34:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:40:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* hFile */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:48:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpBuffer */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:49:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpNumberOfBytesWritten */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:51:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpOverlapped */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:52:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "u32", "pointer", "pointer"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:62:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "u32", "pointer", "pointer"],
                              ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:62:31

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "u32", "pointer", "pointer"],
                                                ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:62:49

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "u32", "pointer", "pointer"],
                                                           ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:62:60

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpName */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:70:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer", /* lpSecurityAttributes */
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:77:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      result: "pointer",
      ~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:79:7

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:85:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer"],
                              ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:85:31

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "pointer", "u8"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:92:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "pointer", "u8"],
                              ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:92:31

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer", "pointer", "u8"],
                                         ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:92:42

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer"],
                   ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:97:20

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
      parameters: ["pointer", "pointer"],
                              ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:97:31

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer",
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:109:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer",
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:112:9

TS2322 [ERROR]: Type '"pointer"' is not assignable to type 'NativeType'.
        "pointer",
        ~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:114:9

TS2694 [ERROR]: Namespace 'Deno' has no exported member 'UnsafePointer'.
export type HANDLE = Deno.UnsafePointer;
                          ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:157:27

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
    new Deno.UnsafePointer(0n),
             ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:171:14

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
    new Deno.UnsafePointer(0n),
             ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:174:14

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
      new Deno.UnsafePointer(0n),
               ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:219:16

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
      new Deno.UnsafePointer(0n),
               ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:238:16

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
    new Deno.UnsafePointer(0n),
             ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:318:14

TS2339 [ERROR]: Property 'UnsafePointerView' does not exist on type 'typeof Deno'.
  const lpBufferView = new Deno.UnsafePointerView(
                                ~~~~~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:369:33

TS2339 [ERROR]: Property 'UnsafePointer' does not exist on type 'typeof Deno'.
    new Deno.UnsafePointer(lpBufferPtr[0]),
             ~~~~~~~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/winapi.ts:370:14

TS2339 [ERROR]: Property 'view' does not exist on type 'never'.
        const v = ctx.byobRequest!.view as Uint8Array;
                                   ~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/client.ts:160:36

TS2339 [ERROR]: Property 'respond' does not exist on type 'never'.
            ctx.byobRequest!.respond(0);
                             ~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/client.ts:166:30

TS2339 [ERROR]: Property 'respond' does not exist on type 'never'.
            ctx.byobRequest!.respond(n);
                             ~~~~~~~
    at https://deno.land/x/namedpipe@0.1.0/src/client.ts:168:30```

Any idea if this is something I can fix? I just installed deno for the first time as well. Thanks!
NextFire commented 2 years ago

Hello, I cannot reproduce the error, which deno version are you using? (deno --version)

jrub1 commented 2 years ago

It says:

deno 1.14.3 (release, x86_64-apple-darwin) v8 9.4.146.19 typescript 4.4.2

NextFire commented 2 years ago

Ok, please update deno to the latest version (1.19.x), there are some breaking changes with this release. (#9)

jrub1 commented 2 years ago

Ah thank you! It's working now, looks great. Thanks for the help and sorry for the bother!

(I can open a new issue for this if necessary) Is there any way to customize the format of the now playing info? Also would it be able to say "paused" when paused instead of getting rid of the status completely?

NextFire commented 2 years ago

I personally preferred something that looked the same as the built-in Spotify integration in term of format and behavior (disappear when paused). Feel free to fork my project and edit the script yourself to your convenience as I will not make changes in this direction for now! (look at the switch-case in setActivity)