mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
feat(halogen): definitions (#12791)
* feat(halogen): definitions * chore(halogen): some correction + remove identical component tests * chore(halogen): replace module by namespace
This commit is contained in:
18
halogen/halogen-clip-loader-tests.tsx
Normal file
18
halogen/halogen-clip-loader-tests.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as React from "react";
|
||||
import * as Halogen from "halogen";
|
||||
|
||||
class HalogenTests_ClipLoader_withNoProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.ClipLoader />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class HalogenTests_ClipLoader_withAllProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.ClipLoader loading={false} color="black" id="MyLoader" className="loader" verticalAlign="bottom" size="200px" />
|
||||
)
|
||||
}
|
||||
}
|
||||
19
halogen/halogen-fade-loader-tests.tsx
Normal file
19
halogen/halogen-fade-loader-tests.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as React from "react";
|
||||
import * as Halogen from "halogen";
|
||||
|
||||
class HalogenTests_FadeLoader_withNoProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.FadeLoader />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class HalogenTests_FadeLoader_withAllProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.FadeLoader loading={false} color="black" id="MyLoader" className="loader" verticalAlign="middle"
|
||||
size="100px" margin="10px" height="200px" width="200px" radius="5px" />
|
||||
)
|
||||
}
|
||||
}
|
||||
18
halogen/halogen-pacman-loader-tests.tsx
Normal file
18
halogen/halogen-pacman-loader-tests.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as React from "react";
|
||||
import * as Halogen from "halogen";
|
||||
|
||||
class HalogenTests_PacmanLoader_withNoProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.PacmanLoader />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class HalogenTests_PacmanLoader_withAllProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.PacmanLoader loading={false} color="black" id="MyLoader" className="loader" verticalAlign="middle" margin={10} size={200} />
|
||||
)
|
||||
}
|
||||
}
|
||||
18
halogen/halogen-rotate-loader-tests.tsx
Normal file
18
halogen/halogen-rotate-loader-tests.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as React from "react";
|
||||
import * as Halogen from "halogen";
|
||||
|
||||
class HalogenTests_RotateLoader_withNoProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.RotateLoader />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class HalogenTests_RotateLoader_withAllProps extends React.Component<React.Props<{}>, {}>{
|
||||
render() {
|
||||
return (
|
||||
<Halogen.RotateLoader loading={false} color="black" id="MyLoader" className="loader" verticalAlign="middle" margin="10px" size="100px" />
|
||||
)
|
||||
}
|
||||
}
|
||||
88
halogen/index.d.ts
vendored
Normal file
88
halogen/index.d.ts
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
// Type definitions for halogen
|
||||
// Project: https://github.com/yuanyan/halogen
|
||||
// Definitions by: Vincent Rouffiat <https://github.com/steller>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as react from "react";
|
||||
|
||||
export = Halogen;
|
||||
|
||||
declare namespace Halogen {
|
||||
|
||||
type VerticalAlign = "baseline" | "length" | "sub" | "super" | "top" | "text-top" | "middle" | "bottom" | "text-bottom" | "initial" | "inherit";
|
||||
|
||||
interface HalogenCommonProps {
|
||||
loading?: boolean;
|
||||
color?: string;
|
||||
id?: string;
|
||||
className?: string;
|
||||
verticalAlign?: VerticalAlign;
|
||||
}
|
||||
|
||||
interface SizeLoaderProps extends HalogenCommonProps {
|
||||
size?: string;
|
||||
}
|
||||
|
||||
interface MarginLoaderProps<T> extends HalogenCommonProps {
|
||||
margin?: T;
|
||||
size?: T;
|
||||
}
|
||||
|
||||
interface RadiusLoaderProps extends MarginLoaderProps<string> {
|
||||
height?: string;
|
||||
width?: string;
|
||||
radius?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* React components
|
||||
*/
|
||||
type PulseLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const PulseLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type RotateLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const RotateLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type BeatLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const BeatLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type RiseLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const RiseLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type SyncLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const SyncLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type GridLoader = react.Component<MarginLoaderProps<string>, {}>;
|
||||
export const GridLoader: react.ComponentClass<MarginLoaderProps<string>>;
|
||||
|
||||
type ClipLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const ClipLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type SquareLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const SquareLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type DotLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const DotLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type PacmanLoader = react.Component<MarginLoaderProps<number>, {}>;
|
||||
export const PacmanLoader: react.ComponentClass<MarginLoaderProps<number>>;
|
||||
|
||||
type MoonLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const MoonLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type RingLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const RingLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type BounceLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const BounceLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type SkewLoader = react.Component<SizeLoaderProps, {}>;
|
||||
export const SkewLoader: react.ComponentClass<SizeLoaderProps>;
|
||||
|
||||
type FadeLoader = react.Component<RadiusLoaderProps, {}>;
|
||||
export const FadeLoader: react.ComponentClass<RadiusLoaderProps>;
|
||||
|
||||
type ScaleLoader = react.Component<RadiusLoaderProps, {}>;
|
||||
export const ScaleLoader: react.ComponentClass<RadiusLoaderProps>;
|
||||
|
||||
}
|
||||
22
halogen/tsconfig.json
Normal file
22
halogen/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"include": [
|
||||
"halogen-*-loader-tests.tsx"
|
||||
]
|
||||
}
|
||||
3
halogen/tslint.json
Normal file
3
halogen/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../tslint.json"
|
||||
}
|
||||
Reference in New Issue
Block a user