mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Typings for vssln-parser (#35651)
This commit is contained in:
parent
635592e97f
commit
acd1c04ea3
42
types/vssln-parser/index.d.ts
vendored
Normal file
42
types/vssln-parser/index.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
// Type definitions for vssln-parser 0.1
|
||||
// Project: https://github.com/mhusseini/vssln-parser
|
||||
// Definitions by: Erik Källén <https://github.com/erik-kallen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from 'fs';
|
||||
|
||||
declare function parse(input: fs.ReadStream | string, callback: (solution: parse.VsSolutionFile) => void): void;
|
||||
|
||||
declare namespace parse {
|
||||
interface VsSolutionFile extends VsSolutionSection, VsSolutionSectionCollection {
|
||||
visualStudioVersion?: string;
|
||||
minimumVisualStudioVersion?: string;
|
||||
projects: VsSolutionProject[];
|
||||
solutionConfigurationPlatforms?: VsSolutionSection;
|
||||
projectConfigurationPlatforms?: VsSolutionSection;
|
||||
solutionProperties?: VsSolutionSection;
|
||||
nestedProjects?: VsSolutionSection;
|
||||
teamFoundationVersionControl?: VsSolutionSection;
|
||||
}
|
||||
|
||||
interface VsSolutionProject extends VsSolutionSection, VsSolutionSectionCollection {
|
||||
name: string;
|
||||
type: string;
|
||||
projectGuid: string;
|
||||
typeGuid: string;
|
||||
path: string;
|
||||
projectDependencies?: VsSolutionSection;
|
||||
}
|
||||
|
||||
interface VsSolutionSection {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
interface VsSolutionSectionCollection {
|
||||
[index: string]: VsSolutionSection;
|
||||
}
|
||||
}
|
||||
|
||||
export = parse;
|
||||
23
types/vssln-parser/tsconfig.json
Normal file
23
types/vssln-parser/tsconfig.json
Normal file
@ -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",
|
||||
"vssln-parser-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/vssln-parser/tslint.json
Normal file
1
types/vssln-parser/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
12
types/vssln-parser/vssln-parser-tests.ts
Normal file
12
types/vssln-parser/vssln-parser-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import * as vsslnparse from 'vssln-parser';
|
||||
import * as fs from 'fs';
|
||||
|
||||
vsslnparse('', solution => {
|
||||
solution.visualStudioVersion; // $ExpectType string | undefined
|
||||
solution.projects[0].name; // $ExpectType string
|
||||
});
|
||||
|
||||
vsslnparse(fs.createReadStream('test.sln'), solution => {
|
||||
solution.visualStudioVersion; // $ExpectType string | undefined
|
||||
solution.projects[0].name; // $ExpectType string
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user