Skip to content

Commit

Permalink
fix(react-core): correct IDependency definition (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
ushkal committed Mar 11, 2019
1 parent 145c574 commit c9d0f44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/dx-react-core/api/dx-react-core.api.ts
Expand Up @@ -38,6 +38,14 @@ type Getters = {
readonly [getterName: string]: any;
};

// @public (undocumented)
interface IDependency {
// (undocumented)
name: string;
// (undocumented)
optional?: boolean;
}

// @public (undocumented)
declare const Plugin: React.ComponentType<PluginProps>;

Expand Down
3 changes: 2 additions & 1 deletion packages/dx-react-core/src/plugin-based/plugin.tsx
@@ -1,9 +1,10 @@
import * as React from 'react';
import { InnerPlugin, IDependency } from '@devexpress/dx-core';
import { InnerPlugin } from '@devexpress/dx-core';
import { PluginIndexer } from './plugin-indexer';
import { PLUGIN_HOST_CONTEXT, POSITION_CONTEXT } from './constants';
import { withHostAndPosition } from '../utils/with-props-from-context';
import { PluginContextProps } from './plugin-context-prop-types';
import { IDependency } from '../types';

export interface PluginProps {
/** React elements that expose the plugin's state and actions and render the plugin's UI. */
Expand Down
8 changes: 8 additions & 0 deletions packages/dx-react-core/src/types.ts
@@ -1,22 +1,30 @@
import { PureReducer, PureComputed } from '@devexpress/dx-core';

export { IDependency } from '../../dx-core/src';

/** @internal */
export type StateHelper = {
applyReducer: PureComputed<[PureReducer, any?, PureReducer?], void>;
applyFieldReducer: PureComputed<[string, PureReducer, any], void>
};

/** @internal */
export type CreateStateHelperFn = PureComputed<
[React.PureComponent, { [fieldName: string]: () => ActionFn<any> | undefined }?],
StateHelper
>;

/** @internal */
export type ActionFn<P> = PureComputed<[P], void | boolean>;
/** @internal */
export type Size = {
readonly width: number;
readonly height: number;
};
/** @internal */
export type onSizeChangeFn = (size: Size) => void;

/** @internal */
export type SizerProps = {
onSizeChange: onSizeChangeFn;
onScroll?: (e) => void;
Expand Down

0 comments on commit c9d0f44

Please sign in to comment.