GT2/Ejectable/node_modules/react-native-gesture-handler/lib/commonjs/web/NodeManager.js.map

1 line
1.7 KiB
Plaintext

{"version":3,"sources":["NodeManager.ts"],"names":["gestures","getHandler","tag","Error","createGestureHandler","handlerTag","handler","dropGestureHandler","destroy","getNodes"],"mappings":";;;;;;;;;AAGA,MAAMA,QAAgE,GAAG,EAAzE;;AAEO,SAASC,UAAT,CAAoBC,GAApB,EAAiC;AACtC,MAAIA,GAAG,IAAIF,QAAX,EAAqB,OAAOA,QAAQ,CAACE,GAAD,CAAf;AAErB,QAAM,IAAIC,KAAJ,8BAAgCD,GAAhC,EAAN;AACD;;AAEM,SAASE,oBAAT,CACLC,UADK,EAELC,OAFK,EAGL;AACA,MAAID,UAAU,IAAIL,QAAlB,EAA4B;AAC1B,UAAM,IAAIG,KAAJ,4BAA8BE,UAA9B,qBAAN;AACD;;AACDL,EAAAA,QAAQ,CAACK,UAAD,CAAR,GAAuBC,OAAvB,CAJA,CAKA;;AACAN,EAAAA,QAAQ,CAACK,UAAD,CAAR,CAAqBA,UAArB,GAAkCA,UAAlC;AACD;;AAEM,SAASE,kBAAT,CAA4BF,UAA5B,EAAgD;AACrDJ,EAAAA,UAAU,CAACI,UAAD,CAAV,CAAuBG,OAAvB,GADqD,CAErD;;AACA,SAAOR,QAAQ,CAACK,UAAD,CAAf;AACD;;AAEM,SAASI,QAAT,GAAoB;AACzB,SAAO,EAAE,GAAGT;AAAL,GAAP;AACD","sourcesContent":["import { ValueOf } from '../typeUtils';\nimport { Gestures } from '../RNGestureHandlerModule.web';\n\nconst gestures: Record<number, InstanceType<ValueOf<typeof Gestures>>> = {};\n\nexport function getHandler(tag: number) {\n if (tag in gestures) return gestures[tag];\n\n throw new Error(`No handler for tag ${tag}`);\n}\n\nexport function createGestureHandler(\n handlerTag: number,\n handler: InstanceType<ValueOf<typeof Gestures>>\n) {\n if (handlerTag in gestures) {\n throw new Error(`Handler with tag ${handlerTag} already exists`);\n }\n gestures[handlerTag] = handler;\n // @ts-ignore no types for web handlers yet\n gestures[handlerTag].handlerTag = handlerTag;\n}\n\nexport function dropGestureHandler(handlerTag: number) {\n getHandler(handlerTag).destroy();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete gestures[handlerTag];\n}\n\nexport function getNodes() {\n return { ...gestures };\n}\n"]}