How can I use @sapphire/shapeshift with nested objects and TypeScript compile. The types are known in VS-Code, but when compiled, the nested objects are turned into any...
const autoCompleteSubreddit = s.object({
numSubscribers: s.number,
name: s.string,
allowedPostTypes: s.object({
images: s.boolean,
text: s.boolean,
videos: s.boolean,
links: s.boolean,
spoilers: s.boolean,
}),
id: s.string,
primaryColor: s.string,
communityIcon: s.union(s.literal(""), s.string.url()),
icon: s.union(s.literal(""), s.string.url()),
});
export type SubredditAutoComplete = InferType<typeof autoCompleteSubreddit>[];
turnes into (.d.ts)
declare const autoCompleteSubreddit: import("@sapphire/shapeshift").ObjectValidator<{
numSubscribers: number;
name: string;
allowedPostTypes: import("@sapphire/shapeshift").UndefinedToOptional<{
images: any;
text: any;
videos: any;
links: any;
spoilers: any;
}>;
id: string;
primaryColor: string;
communityIcon: string;
icon: string;
}, import("@sapphire/shapeshift").UndefinedToOptional<{
numSubscribers: number;
name: string;
allowedPostTypes: import("@sapphire/shapeshift").UndefinedToOptional<{
images: any;
text: any;
videos: any;
links: any;
spoilers: any;
}>;
id: string;
primaryColor: string;
communityIcon: string;
icon: string;
}>>;
export type SubredditAutoComplete = InferType<typeof autoCompleteSubreddit>[];