Skip to content

Typescript version of this? #22

@m1thrandir225

Description

@m1thrandir225

Getting started with solid, and wanted to create something similar but I have been struggling to get the createAgent.js file converted to typescript.

My current problem is:
const headers = {},
body = {},
opts = { method, headers, body };
if (data !== undefined) {
headers["Content-Type"] = "application/json";
opts.body = JSON.stringify(data);
}
But, headers["Content-type"] has this error, which I don't know how to fix, as u can't exactly get the headers type from the fetch api.
Element implicitly has an 'any' type because expression of type '"Content-Type"' can't be used to index type '{}'.
Property 'Content-Type' does not exist on type '{}'.

I know is kinda dumb but any help would be appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions