🤖 Merge PR #65557 feat(rollup-plugin-natives): add type definitions by @mkermani144

This commit is contained in:
Mohammad Kermani
2023-05-28 16:15:41 +03:30
committed by GitHub
parent 95124c4cef
commit fe2f7c4115
5 changed files with 62 additions and 0 deletions

19
types/rollup-plugin-natives/index.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
// Type definitions for rollup-plugin-natives 0.7
// Project: https://github.com/danielgindi/rollup-plugin-natives
// Definitions by: Mohammad Kermani <https://github.com/mkermani144>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Plugin } from 'rollup';
interface RollupPluginNativesOptions {
copyTo?: string;
destDir?: string;
dlopen?: boolean;
map?: (modulePath: string) => string | { name: string; copyTo: string };
targetEsm?: boolean;
sourcemap?: boolean;
}
declare function nativePlugin(options: RollupPluginNativesOptions): Plugin;
export = nativePlugin;

View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"rollup": "^3.22.0"
}
}

View File

@@ -0,0 +1,13 @@
import nativePlugin = require('rollup-plugin-natives');
nativePlugin({}); // $ExpectType Plugin
// $ExpectType Plugin
nativePlugin({
copyTo: './',
destDir: './dist',
dlopen: true,
map: () => '',
sourcemap: true,
targetEsm: true,
});

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"rollup-plugin-natives-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }