Custom types #156

Open
bfirsh opened this Issue Jan 3, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@bfirsh
Contributor

bfirsh commented Jan 3, 2013

Are these something that could be possible? It looks like there has been some thought into how they might work (e.g., you can pass in a type object in the client), but there doesn't seem to be able way to specify them on the server. Perhaps there could be a mapping in the options?

It would be also nice to get access to some of the test helpers - the randomisation things and so on. Maybe they could be exported as share.tests?

@josephg

This comment has been minimized.

Show comment Hide comment
@josephg

josephg Jan 19, 2013

Owner

Yeah all pretty easy.

Custom types can be put into require('share').types.mycooltype = {...}.

On the web, create window.sharejs.types.mycooltype = ...

As for the test helpers - yeah, exporting them sounds good, and should be pretty easy. Just add to src/types/index.coffee. Make a pull request.

Owner

josephg commented Jan 19, 2013

Yeah all pretty easy.

Custom types can be put into require('share').types.mycooltype = {...}.

On the web, create window.sharejs.types.mycooltype = ...

As for the test helpers - yeah, exporting them sounds good, and should be pretty easy. Just add to src/types/index.coffee. Make a pull request.

bfirsh added a commit to bfirsh/ShareJS that referenced this issue Jan 21, 2013

@bfirsh

This comment has been minimized.

Show comment Hide comment
@bfirsh

bfirsh Jan 21, 2013

Contributor

There we go! It would be quite nice to have test/types/randomWord.coffee too - is there a particular reason why that isn't in test/helpers/?

Contributor

bfirsh commented Jan 21, 2013

There we go! It would be quite nice to have test/types/randomWord.coffee too - is there a particular reason why that isn't in test/helpers/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment