mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #30208 from huan086/postcss-modules-resolve-imports
[postcss-modules-resolve-imports] Add Typescript definitions.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// Type definitions for postcss-modules-resolve-imports 1.3
|
||||
// Project: https://github.com/css-modules/postcss-modules-resolve-imports
|
||||
// Definitions by: Jeow Li Huan <https://github.com/huan086>
|
||||
// Definitions: https://github.com/huan086/postcss-plugins-typings
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Plugin } from "postcss";
|
||||
|
||||
declare namespace resolveImports {
|
||||
interface Resolve {
|
||||
alias?: { [alias: string]: string };
|
||||
extensions?: string[];
|
||||
modules?: string[];
|
||||
mainFile?: string;
|
||||
preserveSymlinks?: boolean;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
icssExports?: boolean;
|
||||
resolve?: Resolve;
|
||||
}
|
||||
|
||||
type ResolveImports = Plugin<Options>;
|
||||
}
|
||||
|
||||
declare const resolveImports: resolveImports.ResolveImports;
|
||||
export = resolveImports;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"postcss": "7.x.x"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import path = require("path");
|
||||
import resolveImports = require("postcss-modules-resolve-imports");
|
||||
import { Transformer } from "postcss";
|
||||
|
||||
const ap1: Transformer = resolveImports();
|
||||
|
||||
const ap2: Transformer = resolveImports({
|
||||
icssExports: false,
|
||||
resolve: {
|
||||
alias: {
|
||||
lib: path.resolve(__dirname, "lib"),
|
||||
},
|
||||
extensions: [".css"],
|
||||
modules: [path.resolve(__dirname, "lib")],
|
||||
mainFile: "index.css",
|
||||
preserveSymlinks: false
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"postcss-modules-resolve-imports-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user