Skip to content

Issue with NodeValue, documentation maybe ? #20

@Nytrm

Description

@Nytrm

Hi, great project but the example seems just a little minimal.

I am trying to access the iTunesLibrary from node but i am not sure how to map the values/types to return types.
In this example its just a string that does not seem to work for me.

no exact matches in call to initializer return NodeValue(self.library.applicationVersion)

my plan was to map playlist but i got stuck with just the string.
https://developer.apple.com/documentation/ituneslibrary/itlibrary/allplaylists

import iTunesLibrary
import NodeAPI

@NodeClass final class iTunesLibraryClass {

    private let library: ITLibrary

    @NodeActor
    @NodeConstructor init() throws {
        library = try ITLibrary(apiVersion: "1.0")
    }

    @NodeActor
    @NodeMethod func allPlaylists() throws -> NodeValueConvertible {
        return NodeValue(self.library.applicationVersion)
    }
}

#NodeModule(exports: ["iTunesLibrary": iTunesLibraryClass.deferredConstructor])`

Any documentation or examples that i can check out how this works ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions