@secretlint/types
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -5,3 +5,3 @@ import { SecretLintRuleCreatorOptions } from "./SecretLintRule"; | ||
import { SecretlintCoreSharedOptions } from "./SecretlintCoreSharedOptions"; | ||
export declare type SecretLintConfigDescriptorRule<Options = SecretLintRuleCreatorOptions> = { | ||
export type SecretLintConfigDescriptorRule<Options = SecretLintRuleCreatorOptions> = { | ||
/** | ||
@@ -37,3 +37,3 @@ * **Required** | ||
}; | ||
export declare type SecretLintConfigDescriptorRulePreset<Options = SecretLintRulePresetCreatorOptions> = { | ||
export type SecretLintConfigDescriptorRulePreset<Options = SecretLintRulePresetCreatorOptions> = { | ||
/** | ||
@@ -72,5 +72,5 @@ * **Required** | ||
*/ | ||
export declare type SecretLintConfigDescriptor = { | ||
export type SecretLintConfigDescriptor = { | ||
sharedOptions?: SecretlintCoreSharedOptions; | ||
rules: (SecretLintConfigDescriptorRule | SecretLintConfigDescriptorRulePreset)[]; | ||
}; |
@@ -6,3 +6,3 @@ import { SecretLintRuleIgnoreDescriptor, SecretLintRuleReportDescriptor, SecretLintRuleCreator, SecretLintRuleCreatorOptions } from "./SecretLintRule"; | ||
import { SecretlintCoreSharedOptions } from "./SecretlintCoreSharedOptions"; | ||
export declare type SecretLintCoreConfigRule<Options = SecretLintRuleCreatorOptions> = { | ||
export type SecretLintCoreConfigRule<Options = SecretLintRuleCreatorOptions> = { | ||
/** | ||
@@ -38,3 +38,3 @@ * Rule id that is package name or shorten package name | ||
}; | ||
export declare type SecretLintCoreConfigRulePreset<Options = SecretLintRulePresetCreatorOptions> = { | ||
export type SecretLintCoreConfigRulePreset<Options = SecretLintRulePresetCreatorOptions> = { | ||
/** | ||
@@ -64,5 +64,5 @@ * Rule id that is package name or shorten package name | ||
}; | ||
export declare type SecretLintUnionRuleCreator<Options = SecretLintRuleCreatorOptions | SecretLintRulePresetCreatorOptions> = SecretLintRuleCreator<Options> | SecretLintRulePresetCreator<Options>; | ||
export declare type SecretLintCoreConfigUnionRule<Options = SecretLintRuleCreatorOptions | SecretLintRulePresetCreatorOptions> = SecretLintCoreConfigRule<Options> | SecretLintCoreConfigRulePreset<Options>; | ||
export declare type SecretLintRuleModule = { | ||
export type SecretLintUnionRuleCreator<Options = SecretLintRuleCreatorOptions | SecretLintRulePresetCreatorOptions> = SecretLintRuleCreator<Options> | SecretLintRulePresetCreator<Options>; | ||
export type SecretLintCoreConfigUnionRule<Options = SecretLintRuleCreatorOptions | SecretLintRulePresetCreatorOptions> = SecretLintCoreConfigRule<Options> | SecretLintCoreConfigRulePreset<Options>; | ||
export type SecretLintRuleModule = { | ||
creator: SecretLintUnionRuleCreator; | ||
@@ -75,7 +75,7 @@ }; | ||
*/ | ||
export declare type SecretLintCoreConfig = { | ||
export type SecretLintCoreConfig = { | ||
sharedOptions?: SecretlintCoreSharedOptions; | ||
rules: SecretLintCoreConfigUnionRule[]; | ||
}; | ||
export declare type SecretLintCoreResult = { | ||
export type SecretLintCoreResult = { | ||
filePath: string; | ||
@@ -86,3 +86,3 @@ sourceContent: string | undefined; | ||
}; | ||
export declare type SecretLintCoreResultMessage = { | ||
export type SecretLintCoreResultMessage = { | ||
type: "message"; | ||
@@ -103,3 +103,3 @@ ruleId: string; | ||
}; | ||
export declare type SecretLintCoreIgnoreMessage = { | ||
export type SecretLintCoreIgnoreMessage = { | ||
type: "ignore"; | ||
@@ -116,7 +116,7 @@ ruleId: string; | ||
}; | ||
export declare type SecretLintCoreReportDescriptor = { | ||
export type SecretLintCoreReportDescriptor = { | ||
ruleId: string; | ||
} & SecretLintRuleReportDescriptor; | ||
export declare type SecretLintCoreIgnoreDescriptor = { | ||
export type SecretLintCoreIgnoreDescriptor = { | ||
ruleId: string; | ||
} & SecretLintRuleIgnoreDescriptor; |
@@ -5,4 +5,4 @@ /** | ||
*/ | ||
export declare type SecretlintCoreSharedOptions = { | ||
export type SecretlintCoreSharedOptions = { | ||
[index: string]: any; | ||
}; |
import { SecretLintCoreResult } from "./SecretLintCore"; | ||
export declare type SecretLintFormatterOptions = { | ||
export type SecretLintFormatterOptions = { | ||
/** | ||
@@ -8,2 +8,2 @@ * Default: true | ||
}; | ||
export declare type SecretLintFormatter = (results: SecretLintCoreResult[], formatterConfig: SecretLintFormatterOptions) => string; | ||
export type SecretLintFormatter = (results: SecretLintCoreResult[], formatterConfig: SecretLintFormatterOptions) => string; |
@@ -5,3 +5,3 @@ import { SecretLintSourceIdentifierNode } from "./SecretLintSource"; | ||
import { SecretlintCoreSharedOptions } from "./SecretlintCoreSharedOptions"; | ||
export declare type SecretLintRuleReportDescriptor = { | ||
export type SecretLintRuleReportDescriptor = { | ||
message: SecretLintRuleMessageTranslateResult<any>; | ||
@@ -11,3 +11,3 @@ range: readonly [startIndex: number, endIndex: number]; | ||
}; | ||
export declare type SecretLintRuleIgnoreDescriptor = { | ||
export type SecretLintRuleIgnoreDescriptor = { | ||
message: SecretLintRuleMessageTranslateResult<any>; | ||
@@ -24,3 +24,3 @@ /** | ||
}; | ||
export declare type SecretLintRuleContext = { | ||
export type SecretLintRuleContext = { | ||
sharedOptions: SecretlintCoreSharedOptions; | ||
@@ -31,5 +31,5 @@ createTranslator<T extends SecretLintRuleLocalizeMessages>(messages: T): SecretLintRuleMessageTranslate<T>; | ||
}; | ||
export declare type SecretLintRuleCreatorOptions = {}; | ||
export declare type SecretLintRuleContentType = "binary" | "text" | "all"; | ||
export declare type SecretLintRuleCreator<Options = SecretLintRuleCreatorOptions> = { | ||
export type SecretLintRuleCreatorOptions = {}; | ||
export type SecretLintRuleContentType = "binary" | "text" | "all"; | ||
export type SecretLintRuleCreator<Options = SecretLintRuleCreatorOptions> = { | ||
messages: SecretLintRuleLocalizeMessages; | ||
@@ -47,5 +47,5 @@ meta: { | ||
}; | ||
export declare type SecretLintRuleReportHandler = { | ||
export type SecretLintRuleReportHandler = { | ||
file?(source: SecretLintSourceCode): void | Promise<any>; | ||
identifier?(node: SecretLintSourceIdentifierNode, source: SecretLintSourceCode): void | Promise<any>; | ||
}; |
import { SecretLintCoreConfigRule } from "./SecretLintCore"; | ||
import { SecretLintRuleCreator, SecretLintRuleCreatorOptions } from "./SecretLintRule"; | ||
import { SecretlintCoreSharedOptions } from "./SecretlintCoreSharedOptions"; | ||
export declare type SecretLintRulePresetContext = { | ||
export type SecretLintRulePresetContext = { | ||
sharedOptions: SecretlintCoreSharedOptions; | ||
registerRule<Options = SecretLintRuleCreatorOptions>(rule: SecretLintRuleCreator<Options>, defaultValue?: Omit<SecretLintCoreConfigRule<Options>, "id" | "rule">): void; | ||
registerRule<Options extends SecretLintRuleCreatorOptions = SecretLintRuleCreatorOptions>(rule: SecretLintRuleCreator<Options>, defaultValue?: Omit<SecretLintCoreConfigRule<Options>, "id" | "rule">): void; | ||
}; | ||
export declare type SecretLintRulePresetCreatorOptions = {}; | ||
export declare type SecretLintRulePresetCreator<Options = SecretLintRulePresetCreatorOptions> = { | ||
export type SecretLintRulePresetCreatorOptions = {}; | ||
export type SecretLintRulePresetCreator<Options = SecretLintRulePresetCreatorOptions> = { | ||
meta: { | ||
@@ -11,0 +11,0 @@ id: string; |
/** | ||
* Rule Severity Level | ||
*/ | ||
export declare type SecretLintRuleSeverityLevel = "info" | "warning" | "error"; | ||
export type SecretLintRuleSeverityLevel = "info" | "warning" | "error"; |
@@ -1,7 +0,7 @@ | ||
export declare type SecretLintRuleLocaleTag = "en" | "cs" | "de" | "es" | "fr" | "it" | "ja" | "ko" | "pl" | "ru" | "tr" | "zh-CN" | "zh-TW" | string; | ||
export declare type SecretLintRuleLocalizeMessageProps = { | ||
export type SecretLintRuleLocaleTag = "en" | "cs" | "de" | "es" | "fr" | "it" | "ja" | "ko" | "pl" | "ru" | "tr" | "zh-CN" | "zh-TW" | string; | ||
export type SecretLintRuleLocalizeMessageProps = { | ||
[index: string]: any; | ||
}; | ||
export declare type SecretLintRuleLocalizeMessageHandler<Props extends SecretLintRuleLocalizeMessageProps> = (props?: Props) => string; | ||
export declare type SecretLintRuleLocalizeMessageMulti<Props extends SecretLintRuleLocalizeMessageProps> = { | ||
export type SecretLintRuleLocalizeMessageHandler<Props extends SecretLintRuleLocalizeMessageProps> = (props?: Props) => string; | ||
export type SecretLintRuleLocalizeMessageMulti<Props extends SecretLintRuleLocalizeMessageProps> = { | ||
[P in SecretLintRuleLocaleTag]: SecretLintRuleLocalizeMessageHandler<Props>; | ||
@@ -22,6 +22,6 @@ } & { | ||
*/ | ||
export declare type SecretLintRuleLocalizeMessages = { | ||
export type SecretLintRuleLocalizeMessages = { | ||
[index: string]: SecretLintRuleLocalizeMessageMulti<any>; | ||
}; | ||
export declare type SecretLintRuleMessageTranslateResult<Props extends SecretLintRuleLocalizeMessageProps> = { | ||
export type SecretLintRuleMessageTranslateResult<Props extends SecretLintRuleLocalizeMessageProps> = { | ||
message: string; | ||
@@ -31,5 +31,5 @@ messageId: string; | ||
}; | ||
declare type ValueOf<T> = T[keyof T]; | ||
export declare type SecretLintRuleMessageTranslate<T extends SecretLintRuleLocalizeMessages, MessageId extends keyof T = keyof T, Props extends Parameters<ValueOf<T[MessageId]>>[0] = Parameters<ValueOf<T[MessageId]>>[0]> = (messageId: MessageId, props?: Props) => SecretLintRuleMessageTranslateResult<Props>; | ||
export declare type SecretLintCreateRuleMessageTranslator<T extends SecretLintRuleLocalizeMessages> = (messages: T) => SecretLintRuleMessageTranslate<T>; | ||
type ValueOf<T> = T[keyof T]; | ||
export type SecretLintRuleMessageTranslate<T extends SecretLintRuleLocalizeMessages, MessageId extends keyof T = keyof T, Props extends Parameters<ValueOf<T[MessageId]>>[0] = Parameters<ValueOf<T[MessageId]>>[0]> = (messageId: MessageId, props?: Props) => SecretLintRuleMessageTranslateResult<Props>; | ||
export type SecretLintCreateRuleMessageTranslator<T extends SecretLintRuleLocalizeMessages> = (messages: T) => SecretLintRuleMessageTranslate<T>; | ||
export {}; |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export declare type SecretLintRawSource = { | ||
export type SecretLintRawSource = { | ||
content: string; | ||
@@ -22,3 +22,3 @@ filePath: string; | ||
}; | ||
export declare type SecretLintSourceNodePosition = { | ||
export type SecretLintSourceNodePosition = { | ||
line: number; | ||
@@ -31,8 +31,8 @@ column: number; | ||
*/ | ||
export declare type SecretLintSourceNodeLocation = { | ||
export type SecretLintSourceNodeLocation = { | ||
start: SecretLintSourceNodePosition; | ||
end: SecretLintSourceNodePosition; | ||
}; | ||
export declare type SecretLintSourceNodeRange = readonly [startIndex: number, endIndex: number]; | ||
export declare type SecretLintSourceValueNode = { | ||
export type SecretLintSourceNodeRange = readonly [startIndex: number, endIndex: number]; | ||
export type SecretLintSourceValueNode = { | ||
type: "Value"; | ||
@@ -43,3 +43,3 @@ value: string; | ||
}; | ||
export declare type SecretLintSourceIdentifierNode = { | ||
export type SecretLintSourceIdentifierNode = { | ||
type: "Identifier"; | ||
@@ -46,0 +46,0 @@ name: string; |
{ | ||
"name": "@secretlint/types", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "A typing package for @secretlint", | ||
@@ -43,6 +43,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^18.11.17", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^18.11.18", | ||
"mocha": "^10.2.0", | ||
"prettier": "^2.7.1", | ||
"prettier": "^2.8.1", | ||
"rimraf": "^3.0.2", | ||
@@ -52,3 +52,3 @@ "ts-node": "^10.9.1", | ||
"tsd": "^0.25.0", | ||
"typescript": "^4.7.4" | ||
"typescript": "^4.9.4" | ||
}, | ||
@@ -61,3 +61,3 @@ "engines": { | ||
}, | ||
"gitHead": "67f291f3857b462d2b998d00c26d3c58a26c0d72" | ||
"gitHead": "15a9f79e558fed32a4cead3943754d6ec55890af" | ||
} |
@@ -8,3 +8,3 @@ // Rule Interfaces | ||
sharedOptions: SecretlintCoreSharedOptions; | ||
registerRule<Options = SecretLintRuleCreatorOptions>( | ||
registerRule<Options extends SecretLintRuleCreatorOptions = SecretLintRuleCreatorOptions>( | ||
rule: SecretLintRuleCreator<Options>, | ||
@@ -11,0 +11,0 @@ defaultValue?: Omit<SecretLintCoreConfigRule<Options>, "id" | "rule"> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37773
0
37578
70
0
0
0
12