Apply strictNullChecks to src/components/views/auth/* (#10299

* Apply `strictNullChecks` to src/components/views/auth/*

* Iterate PR
This commit is contained in:
Michael Telatynski
2023-03-07 10:45:55 +00:00
committed by GitHub
parent c79eff2292
commit 32aa18ff2e
16 changed files with 127 additions and 122 deletions

View File

@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from "react";
import React, { ReactNode } from "react";
import classNames from "classnames";
type Data = Pick<IFieldState, "value" | "allowEmpty">;
@@ -31,13 +31,13 @@ interface IRule<T, D = undefined> {
final?: boolean;
skip?(this: T, data: Data, derivedData: D): boolean;
test(this: T, data: Data, derivedData: D): boolean | Promise<boolean>;
valid?(this: T, derivedData: D): string;
invalid?(this: T, derivedData: D): string;
valid?(this: T, derivedData: D): string | null;
invalid?(this: T, derivedData: D): string | null;
}
interface IArgs<T, D = void> {
rules: IRule<T, D>[];
description?(this: T, derivedData: D, results: IResult[]): React.ReactChild;
description?(this: T, derivedData: D, results: IResult[]): ReactNode;
hideDescriptionIfValid?: boolean;
deriveData?(data: Data): Promise<D>;
}