feat(lib/externals): export react-native-clipboard

This commit is contained in:
PalmDevs 2025-05-10 02:06:23 +07:00
parent 0202254e7f
commit 81f529c607
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
5 changed files with 54 additions and 0 deletions

View file

@ -6,6 +6,7 @@
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@parcel/watcher": "^2.5.1",
"@react-native-clipboard/clipboard": "^1.16.2",
"@swc/core": "^1.11.21",
"@types/bun": "latest",
"@types/node": "^22.15.3",
@ -396,6 +397,8 @@
"@parcel/watcher-win32-x64": ["@parcel/watcher-win32-x64@2.5.1", "", { "os": "win32", "cpu": "x64" }, "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA=="],
"@react-native-clipboard/clipboard": ["@react-native-clipboard/clipboard@1.16.2", "", { "peerDependencies": { "react": ">= 16.9.0", "react-native": ">= 0.61.5", "react-native-macos": ">= 0.61.0", "react-native-windows": ">= 0.61.0" }, "optionalPeers": ["react-native-macos", "react-native-windows"] }, "sha512-VqUYwVxo7DyHMz7v2LxLMaAOSu3pKFvzpqR4jQezdH0VyaudILTTcUf7dR4TroARU/lLkTU8nZA11UniTvGVXg=="],
"@react-native/assets-registry": ["@react-native/assets-registry@0.76.6", "", {}, "sha512-YI8HoReYiIwdFQs+k9Q9qpFTnsyYikZxgs/UVtVbhKixXDQF6F9LLvj2naOx4cfV+RGybNKxwmDl1vUok/dRFQ=="],
"@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.76.6", "", { "dependencies": { "@react-native/codegen": "0.76.6" } }, "sha512-yFC9I/aDBOBz3ZMlqKn2NY/mDUtCksUNZ7AQmBiTAeVTUP0ujEjE0hTOx5Qd+kok7A7hwZEX87HdSgjiJZfr5g=="],

View file

@ -6,6 +6,9 @@
"./browserify": {
"default": "./src/browserify.ts"
},
"./react-native-clipboard": {
"default": "./src/react-native-clipboard.ts"
},
"./react-navigation": {
"default": "./src/react-navigation.ts"
},

View file

@ -0,0 +1,43 @@
import { byDependencies, byProps, every, preferExports, relativeDep } from '@revenge-mod/modules/finders/filters'
import { lookupModule } from '@revenge-mod/modules/finders/lookup'
import { ReactModuleId, ReactNativeModuleId } from '@revenge-mod/react'
import { destructure, proxify } from '@revenge-mod/utils/proxy'
let ClipboardModule: typeof import('@react-native-clipboard/clipboard') = proxify(
() => {
// ID: 4790
// r6 = 4790;
// r5 = [4791, 4792];
// r6 = 4791;
// r5 = [175, 4792];
// r6 = 4792;
// r5 = [27, 4793];
const module = lookupModule(
preferExports(
byProps<typeof ClipboardModule>('useClipboard'),
every(
byDependencies([relativeDep(1), relativeDep(2)]),
byDependencies([
[ReactModuleId, relativeDep(2, true)],
[ReactNativeModuleId, relativeDep(3, true)],
]),
),
),
{
includeUninitialized: true,
},
)
if (module) return (ClipboardModule = module)
},
{
hint: 'object',
},
)!
export const { useClipboard } = destructure(ClipboardModule, { hint: 'function' })
export const { default: Clipboard } = destructure(ClipboardModule, { hint: 'object' })

View file

@ -1,5 +1,6 @@
export interface PluginApiExternals {
Browserify: typeof import('@revenge-mod/externals/browserify')
ReactNativeClipboard: typeof import('@revenge-mod/externals/react-native-clipboard')
ReactNavigation: typeof import('@revenge-mod/externals/react-navigation')
Shopify: typeof import('@revenge-mod/externals/shopify')
}
@ -8,6 +9,9 @@ export const externals: PluginApiExternals = {
get Browserify() {
return (this.Browserify = require('@revenge-mod/externals/browserify'))
},
get ReactNativeClipboard() {
return (this.ReactNativeClipboard = require('@revenge-mod/externals/react-native-clipboard'))
},
get ReactNavigation() {
return (this.ReactNavigation = require('@revenge-mod/externals/react-navigation'))
},

View file

@ -5,6 +5,7 @@
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@parcel/watcher": "^2.5.1",
"@react-native-clipboard/clipboard": "^1.16.2",
"@swc/core": "^1.11.21",
"@types/bun": "latest",
"@types/node": "^22.15.3",