Skip to content

Commit

Permalink
fix: be more explicit about slot param
Browse files Browse the repository at this point in the history
BREAKING CHANGE: renamed some interfaces...
  • Loading branch information
mikaelkaron committed Jun 18, 2019
1 parent df03d94 commit ef9d426
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 131 deletions.
34 changes: 14 additions & 20 deletions packages/stencil-xstate-router/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ import {
} from 'xstate';
import {
ComponentRenderer,
RenderInterpreterOptions,
RouteEventObject,
StateRenderer,
} from '.';
import {
ComponentRenderer as ComponentRenderer2,
NavigationHandler,
RenderInterpreterOptions as RenderInterpreterOptions2,
RouteEventObject as RouteEventObject2,
RouteEvent,
RouteHandler,
StateRenderer as StateRenderer2,
} from './components/xstate-router/index';
RouterInterpreterOptions,
StateRenderer,
} from './components/xstate-router/types';


export namespace Components {
Expand All @@ -50,15 +44,15 @@ export namespace Components {
/**
* Interpreter options
*/
'options'?: RenderInterpreterOptions;
'options'?: RouterInterpreterOptions;
/**
* The main URL of your application.
*/
'root'?: string;
/**
* State renderer
*/
'stateRenderer'?: StateRenderer<any, any, RouteEventObject>;
'stateRenderer'?: StateRenderer<any, any, RouteEvent>;
/**
* If useHash set to true then the router uses an old routing approach with hash in the URL. Fall back to this mode if there is no History API supported.
*/
Expand All @@ -84,15 +78,15 @@ export namespace Components {
/**
* Interpreter options
*/
'options'?: RenderInterpreterOptions;
'options'?: RouterInterpreterOptions;
/**
* The main URL of your application.
*/
'root'?: string;
/**
* State renderer
*/
'stateRenderer'?: StateRenderer<any, any, RouteEventObject>;
'stateRenderer'?: StateRenderer<any, any, RouteEvent>;
/**
* If useHash set to true then the router uses an old routing approach with hash in the URL. Fall back to this mode if there is no History API supported.
*/
Expand All @@ -119,15 +113,15 @@ export namespace Components {
/**
* Interpreter options
*/
'options'?: RenderInterpreterOptions;
'options'?: RouterInterpreterOptions;
/**
* Callback for route subscriptions
*/
'route': RouteHandler<any, any, RouteEventObject>;
'route': RouteHandler<any, any, RouteEvent>;
/**
* State renderer
*/
'stateRenderer'?: StateRenderer<any, any, RouteEventObject>;
'stateRenderer'?: StateRenderer<any, any, RouteEvent>;
}
interface XstateRouterAttributes extends StencilHTMLAttributes {
/**
Expand All @@ -149,15 +143,15 @@ export namespace Components {
/**
* Interpreter options
*/
'options'?: RenderInterpreterOptions;
'options'?: RouterInterpreterOptions;
/**
* Callback for route subscriptions
*/
'route'?: RouteHandler<any, any, RouteEventObject>;
'route'?: RouteHandler<any, any, RouteEvent>;
/**
* State renderer
*/
'stateRenderer'?: StateRenderer<any, any, RouteEventObject>;
'stateRenderer'?: StateRenderer<any, any, RouteEvent>;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

## Properties

| Property | Attribute | Description | Type | Default |
| ---------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| `capture` | `capture` | Capture clicks from child elements and convert to routes | `boolean` | `true` |
| `componentRenderer` | -- | Component renderer | `(component: string, props?: ComponentProps<any, any, EventObject>) => Element \| Element[]` | `undefined` |
| `hash` | `hash` | The hash parameter allows you to configure the hash character | `string` | `'#'` |
| `machine` _(required)_ | -- | An XState machine | `StateMachine<any, any, EventObject>` | `undefined` |
| `options` | -- | Interpreter options | `RenderInterpreterOptions` | `undefined` |
| `root` | `root` | The main URL of your application. | `string` | `undefined` |
| `stateRenderer` | -- | State renderer | `(component: Element \| Element[], current: State<any, RouteEventObject>, send: (event: SingleOrArray<OmniEvent<RouteEventObject>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEventObject>, service: Interpreter<any, any, RouteEventObject>) => Element \| Element[]` | `undefined` |
| `useHash` | `use-hash` | If useHash set to true then the router uses an old routing approach with hash in the URL. Fall back to this mode if there is no History API supported. | `boolean` | `false` |
| Property | Attribute | Description | Type | Default |
| ---------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| `capture` | `capture` | Capture clicks from child elements and convert to routes | `boolean` | `true` |
| `componentRenderer` | -- | Component renderer | `(component: string, props?: ComponentProps<any, any, EventObject>) => Element \| Element[]` | `undefined` |
| `hash` | `hash` | The hash parameter allows you to configure the hash character | `string` | `'#'` |
| `machine` _(required)_ | -- | An XState machine | `StateMachine<any, any, EventObject>` | `undefined` |
| `options` | -- | Interpreter options | `RouterInterpreterOptions` | `undefined` |
| `root` | `root` | The main URL of your application. | `string` | `undefined` |
| `stateRenderer` | -- | State renderer | `(component: Element \| Element[], current: State<any, RouteEvent>, send: (event: SingleOrArray<OmniEvent<RouteEvent>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEvent>, service: Interpreter<any, any, RouteEvent>) => Element \| Element[]` | `undefined` |
| `useHash` | `use-hash` | If useHash set to true then the router uses an old routing approach with hash in the URL. Fall back to this mode if there is no History API supported. | `boolean` | `false` |


----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import Navigo from 'navigo';
import { EventObject, StateMachine } from 'xstate';
import {
ComponentRenderer,
RenderInterpreterOptions,
RouteEventObject,
RouteEvent,
RouterInterpreterOptions,
StateRenderer
} from '../..';
} from '../xstate-router/types';

@Component({
tag: 'xstate-router-navigo',
Expand All @@ -29,12 +29,12 @@ export class XStateRouterNavigo implements ComponentInterface {
/**
* Interpreter options
*/
@Prop() options?: RenderInterpreterOptions;
@Prop() options?: RouterInterpreterOptions;

/**
* State renderer
*/
@Prop() stateRenderer?: StateRenderer<any, any, RouteEventObject>;
@Prop() stateRenderer?: StateRenderer<any, any, RouteEvent>;

/**
* Component renderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

## Properties

| Property | Attribute | Description | Type | Default |
| ---------------------- | --------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `componentRenderer` | -- | Component renderer | `(component: string, props?: ComponentProps<any, any, EventObject>) => Element \| Element[]` | `renderComponent` |
| `machine` _(required)_ | -- | An XState machine | `StateMachine<any, any, EventObject>` | `undefined` |
| `navigate` | -- | Callback for url changes | `(url: string) => void` | `() => {}` |
| `options` | -- | Interpreter options | `RenderInterpreterOptions` | `undefined` |
| `route` | -- | Callback for route subscriptions | `(routes: [{ [key: string]: any; path: string; }], send: (event: SingleOrArray<OmniEvent<RouteEventObject>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEventObject>) => VoidFunction[]` | `() => []` |
| `stateRenderer` | -- | State renderer | `(component: Element \| Element[], current: State<any, RouteEventObject>, send: (event: SingleOrArray<OmniEvent<RouteEventObject>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEventObject>, service: Interpreter<any, any, RouteEventObject>) => Element \| Element[]` | `undefined` |
| Property | Attribute | Description | Type | Default |
| ---------------------- | --------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `componentRenderer` | -- | Component renderer | `(component: string, props?: ComponentProps<any, any, EventObject>) => Element \| Element[]` | `renderComponent` |
| `machine` _(required)_ | -- | An XState machine | `StateMachine<any, any, EventObject>` | `undefined` |
| `navigate` | -- | Callback for url changes | `(url: string) => void` | `() => {}` |
| `options` | -- | Interpreter options | `RouterInterpreterOptions` | `undefined` |
| `route` | -- | Callback for route subscriptions | `(routes: [{ [key: string]: any; path: string; }], send: (event: SingleOrArray<OmniEvent<RouteEvent>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEvent>) => VoidFunction[]` | `() => []` |
| `stateRenderer` | -- | State renderer | `(component: Element \| Element[], current: State<any, RouteEvent>, send: (event: SingleOrArray<OmniEvent<RouteEvent>>, payload?: Record<string, any> & { type?: undefined; }) => State<any, RouteEvent>, service: Interpreter<any, any, RouteEvent>) => Element \| Element[]` | `undefined` |


----------------------------------------------
Expand Down
Loading

0 comments on commit ef9d426

Please sign in to comment.