1
0
mirror of synced 2026-04-05 07:48:35 +08:00

style: 更新eslint版本,更新eslint配置

This commit is contained in:
roymondchen
2025-04-21 20:35:54 +08:00
parent 5e0e776d40
commit e7e9197ae3
88 changed files with 1878 additions and 1141 deletions

View File

@@ -37,13 +37,15 @@ export interface UseAppOptions<T extends MNodeInstance = MNodeInstance> {
};
}
export const useNode = (
export const useNode = <T extends TMagicNode = TMagicNode>(
props: Pick<UseAppOptions, 'config' | 'iteratorContainerId' | 'iteratorIndex'>,
app = useContext(AppContent),
) =>
isDslNode(props.config) && props.config.id
? app?.getNode(props.config.id, props.iteratorContainerId, props.iteratorIndex)
: undefined;
): T | undefined => {
if (isDslNode(props.config) && props.config.id) {
app?.getNode(props.config.id, props.iteratorContainerId, props.iteratorIndex);
}
return void 0;
};
export const registerNodeHooks = (node?: TMagicNode, methods: Methods = {}) => {
if (!node) {