This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div | |
class="left"> | |
Left passed content here | |
<ng-content | |
select="[left]"> | |
</ng-content> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An *action* is a plain object that represents an intention to change the | |
* state. Actions are the only way to get data into the store. Any data, | |
* whether from UI events, network callbacks, or other sources such as | |
* WebSockets needs to eventually be dispatched as actions. | |
* | |
* Actions must have a `type` field that indicates the type of action being | |
* performed. Types can be defined as constants and imported from another | |
* module. It's better to use strings for `type` than Symbols because strings | |
* are serializable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ДЕЛАЕМ ГОВНО ЧТОБ НЕ БЫЛО ГОВНА | |
const fs = require('fs'); | |
const Path = require('path'); | |
if (!String.prototype.splice) { | |
String.prototype.splice = function(start, delCount, newSubStr) { | |
return this.slice(0, start) + newSubStr + this.slice(start + Math.abs(delCount)); | |
}; | |
} | |
function readDirR(dir) { | |
return (fs.statSync(dir).isDirectory() && !dir.endsWith('wscommontypes10')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDtsContent(doc) { | |
console.log(doc.props) | |
return (` | |
import { Component } from 'react'; | |
${doc.composes.map(({ componentName, filePath }) => | |
`import { ${componentName}Props } from './${path.relative(path.dirname(doc.filePath), filePath )}'` | |
)} | |
export interface ${doc.componentName}Props ${doc.composes.length > 0? `extends ${doc.composes.map(({componentName}) => `${componentName}Props`).join(' & ')}`: ''}{ | |
${Object.keys(doc.props).map(propName => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from 'react'; | |
import { Store, Dispatch, ActionCreator } from 'redux'; | |
import { connect as reduxConnect} from 'react-redux'; | |
export class ElementClass<P, S> extends Component<P, S> { } | |
export interface ClassDecorator<P, S, T> { | |
<P, S, T extends constructorof<ElementClass<P, S>>>(component: T): T | |
} | |
interface MapStateToProps<P> { | |
(state: any, ownProps?: any): P; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function connect<P,S,T extends constructorof<ElementClass<P,S>>>(mapStateToProps?: MapStateToProps<P>, | |
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject, | |
mergeProps?: MergeProps, | |
options?: Options): ClassDecorator<P,S,T>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SyncAction { | |
type: any; | |
} | |
interface AsyncAction { | |
(dispatch: (action: SyncAction | AsyncAction)=> any, getState:()=> AppState): void | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import * as Dropzone from 'react-dropzone'; | |
class DropzoneDemo extends React.Component<{}, {}> { | |
onDrop(files) { | |
console.log('Received files: ', files); | |
} | |
render() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type definitions for react-dropzone | |
// Project: https://github.com/paramaggarwal/react-dropzone | |
// Definitions by: Mathieu Larouche Dube <https://github.com/matdube> | |
// Definitions: https://github.com/Vooban/DefinitelyTyped | |
///<reference path='../react/react.d.ts' /> | |
declare module ReactDropzone { | |
import React = __React; | |
interface DropzoneProps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require("webpack"); | |
module.exports = { | |
entry: { | |
vendorJquery: ['jquery'], // names of modules (name of module, which u use for import statement in ts/js) | |
vendorReact: ['react', 'react-dom'], // names of modules (name of module, which u use for import statement in ts/js) | |
app: './scripts/app/app.tsx', | |
models: "./scripts/models/country.ts", | |
components: ["./scripts/components/countryTable.tsx", "./scripts/components/countryTableRow.tsx"], | |
}, |
NewerOlder