Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Поправить типизацию в de.object, чтобы нельзя было передать de.func #79

Open
Pomkaize opened this issue Mar 2, 2025 · 0 comments

Comments

@Pomkaize
Copy link

Pomkaize commented Mar 2, 2025

import * as de from 'descript';

interface ParamsTop {
    param1: string;
    param2: string;
}

interface ParamsResource1 {
    resourceParams: string;
}
interface ParamsResource2 {
    resourceParams: string;
}


const block1 = de.func({
    block: ({ params }: { params: ParamsTop }) => {
        return de.object({
            block: {
                resource1: de.func({
                    block: ({ params }: { params: ParamsResource1 }) => {
                        return 'resource1 result'
                    },
                }),
                combined: de.object({
                    // должна быть ошибка по типам, это de.func
                    block: ({ params }: { params: ParamsResource2 }) => {
                            return 'resource2 result';
                    }
                }),
            }
        });
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant