{"_id":"ottypes","_rev":"20-cd8e7af54636219b72e029226f712fb4","name":"ottypes","description":"Operational transform types collection","dist-tags":{"latest":"1.0.3"},"versions":{"0.6.1":{"name":"ottypes","version":"0.6.1","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"node_modules/.bin/mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"BSD","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","_id":"ottypes@0.6.1","dist":{"shasum":"7464fe451bfb4d59d918430597c980f7b80b65cd","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-0.6.1.tgz","integrity":"sha512-ugkyvFWtWXGeC4W05wCRTY3GKF4CaPtk7pELZ692eVmBSwp0KYihnEI8n6tVh2DIBFVQQfmJ8j6FLLucVZpgaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs4l4W7swhoRrGOJq73wEHzl2/0RBKLjldfsdxCb5ZVwIgNmDHuy2oDCFCg5J91vmy25fmQzq+Cpq2oUcxDu70wGg="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"0.6.2":{"name":"ottypes","version":"0.6.2","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"node_modules/.bin/mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"BSD","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"_id":"ottypes@0.6.2","dist":{"shasum":"fd10f6c52d8964e9fb15dfcc39910a8e4d4046bc","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-0.6.2.tgz","integrity":"sha512-lGDy6YXVEEO5aZ7zu9Zkcop15KpEOt0pKIxH19jHIsjOfQUqY0CcPQ9QEwvMXtO8PYJ6cXpoie1V3Rtsc+WQFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4eqKyqxpV6eUgFtSVx9g7Evz/aRctOUyEVF8HL/EH3gIgPawv+QGFrK+J+IU34sJlkEWCM63/jPusQEU84oa/M8k="}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"1.0.0alpha":{"name":"ottypes","version":"1.0.0alpha","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"node_modules/.bin/mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"MIT","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"_id":"ottypes@1.0.0alpha","dist":{"shasum":"c71985339f2cd3d58df9c3ec1870945fd51c3992","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-1.0.0alpha.tgz","integrity":"sha512-LOnUSdsMWfNIafZGCwQXlX6v0aQ0apd0+rQ5Yx9saa6dOceDxRzo4PBoQJuGwpWjB3Cdke3yjGnPt5dNWLM2nQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsS+09xwbyqh41pJe7mrSQVfB7ivxD2+x8FXidN29nTgIgC4Z7NNHbOoqCEgyYUdXSbI2HoPNH1ZNS9v97TXj59hA="}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"1.0.0":{"name":"ottypes","version":"1.0.0","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"node_modules/.bin/mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","operational transformation","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"MIT","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"_id":"ottypes@1.0.0","dist":{"shasum":"baf74383476ae126a9bf8ec5851e10d1a861f648","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-1.0.0.tgz","integrity":"sha512-1RDMMGPg5EPxpdTuaz/jcqI5VjvPMGljwSn4PlpJfoYH7rmG3cjif2pzNloSxxCrFA1+GkFmRdGE4bJyiu5ZbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBdiobgoRwhDs+FHa7kyrZPXz3a8dLYIYafDdhqBzy91AiEA5jpeES+GVNVfbPHFGdlaXFQ5X7TVdAHndyvD8Gq+t58="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"1.0.1":{"name":"ottypes","version":"1.0.1","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"node_modules/.bin/mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","operational transformation","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"MIT","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"_id":"ottypes@1.0.1","dist":{"shasum":"552582d50167cd268fcb09f16d016fa72f123984","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-1.0.1.tgz","integrity":"sha512-i30QKgr3C/0SwPU32wVj4ZAAXD0jjDFpSokx2eQejdXLIMFD5Nz++7sBNAbmfK+r8xdYCUBJrYq+yp3l43ezgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZxxZ0OUR5u2NYYFYJ6NPdb6GBugEn1uI491vw8sJhnwIgEML4nxEIbM3ASS2iiBXibxFe5K4WHxvaCk1q4BMW9+E="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"josephg","email":"josephg@gmail.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"1.0.2":{"name":"ottypes","version":"1.0.2","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","operational transformation","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"MIT","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"homepage":"https://github.com/share/ot-types","_id":"ottypes@1.0.2","dist":{"shasum":"36bdc79b80f7c2941252967e8efa20c28f92608d","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-1.0.2.tgz","integrity":"sha512-a0dxOyNuDyprtpfnWaEFBd/R4/Q3IpSlLINLIm+miKiCRa6ksSoZDugDtbYpSfBNvGEDi9MHPqdhLvZtZgTWXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmSReqTXDMLjTWNjYE7uZY2MJJTaaoHsMBhB9GHE0X1QIhAKcJNGyyqa2lAZwQt4qVM/VYprdqQoQ6c8O0aFyjaWRC"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"josephg","email":"me@josephg.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"}]},"1.0.3":{"name":"ottypes","version":"1.0.3","description":"Operational transform types collection","main":"lib/index.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"coffee-script":"*","mocha":"~1","uglify-js":"*"},"scripts":{"prepublish":"make all","test":"mocha"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"keywords":["OT","operational transformation","transform"],"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"license":"MIT","gitHead":"1ca38c758dd0ae57142bf892e318ea5a29e9cf92","bugs":{"url":"https://github.com/share/ot-types/issues"},"homepage":"https://github.com/share/ot-types","_id":"ottypes@1.0.3","dist":{"shasum":"6752ae955264b954f897c9ad1bfda147b233fe5e","tarball":"https://registry.npmjs.org/ottypes/-/ottypes-1.0.3.tgz","integrity":"sha512-q/m3JMRtkf1qRhHSYXde8NISZurqXV1LrhLsmnI3DczTzA9bnClUr1hcsOz7yUVNPMRSa/x+b8ryli+0C8x/bw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEr5AQT+oxqLUgmKoc/BTFjT7bRSYgmRFxpz7SyqWT4CAiEA4wlO+xWd4B0vVLHpsH8ygRNMVNOmeT58GY+FWXk4WNc="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"josephg","email":"me@josephg.com"},"maintainers":[{"name":"josephg","email":"josephg@gmail.com"},{"name":"nateps","email":"nate@nateps.com"}]}},"readme":"# Operational transform types, sir?\n\nWe have a lovely buffet of operational transform types. Each type has many fine features, including thorough testing, browser support and documentation.\n\nThese types have been finely aged in [ShareJS](https://github.com/josephg/sharejs)'s type labs. We are quite proud of them.\n\nPlease port any types you find useful to your favorite languages so we can do operational transform in more places. I have a sister project for C versions [here](https://github.com/share/libot) that I might merge in at some point.\n\n[![Build Status](https://secure.travis-ci.org/josephg/ot-types.png)](http://travis-ci.org/josephg/ot-types)\n\n## Spec\n\nEach OT type exposes a single object with the following properties. Note that only *name*, *create*, *apply* and *transform* are strictly required, though most types should also include *url* and *compose*.\n\n### Standard properties\n\n- **name**: A user-readable name for the type. This is not guaranteed to be unique.\n- **uri**: *(Optional, will be required soon)* A canonical location for this type. The spec for the OT type should be at this address. Remember kids, Tim Berners-Lee says [cool URLs don't change](http://www.w3.org/Provider/Style/URI.html).\n- **create([initialData]) -> snapshot**: A function to create the initial document snapshot. Create may accept initial snapshot data as its only argument. Either the return value must be a valid target for `JSON.stringify` or you must specify *serialize* and *deserialize* functions (described below).\n- **apply(snapshot, op) -> snapshot'**: Apply an operation to a document snapshot. Returns the changed snapshot. For performance, old document must not be used after this function call, so apply may reuse and return the current snapshot object.\n- **transform(op1, op2, side) -> op1'**: Transform op1 by op2. Return the new op1. Side is either `'left'` or `'right'`. It exists to break ties, for example if two operations insert at the same position in a string. Both op1 and op2 must not be modified by transform.\nTransform must conform to Transform Property 1. That is, apply(apply(snapshot, op1), transform(op2, op1, 'left')) == apply(apply(snapshot, op2), transform(op1, op2, 'right')).\n- **compose(op1, op2) -> op**: *(optional)* Compose op1 and op2 to produce a new operation. The new operation must subsume the behaviour of op1 and op2. Specifically, apply(snapshot, apply(op1), op2) == apply(snapshot, compose(op1, op2)). Note: transforming by a composed operation is *NOT* guaranteed to produce the same result as transforming by each operation in order. This function is optional, but unless you have a good reason to do otherwise, you should provide a compose function for your type.\n\n### Optional properties\n\n- **invert(op) -> op'**: *(optional)* Invert the given operation. The original operation must not be edited in the process. If supplied, apply(apply(snapshot, op), invert(op)) == snapshot.\n- **normalize(op) -> op'**: *(optional)* Normalize an operation, converting it to a canonical representation. normalize(normalize(op)) == normalize(op).\n- **transformCursor(cursor, op, isOwnOp) -> cursor'**: *(optional)* transform the specified cursor by the provided operation. If isOwnOp is true, this function should return the final editing position of the provided operation. If isOwnOp is false, the cursor position should move with the content to its immediate left.\n- **serialize(snapshot) -> data**: *(optional)* convert the document snapshot data into a form that may be passed to JSON.stringify. If you have a *serialize* function, you must have a *deserialize* function.\n- **deserialize(data) -> snapshot**: *(optional)* convert data generated by *serialize* back into its internal snapshot format. deserialize(serialize(snapshot)) == snapshot. If you have a *deserialize* function, you must have a *serialize* function.\n\n> Do I need serialize and deserialize? Maybe JSON.stringify is sufficiently customizable..?\n\n### TP2 Properties\n\nIf your OT type supports [transform property 2](http://en.wikipedia.org/wiki/Operational_transformation#Convergence_properties), set the *tp2* property to true and define a *prune* function.\n\nTransform property 2 is an additional requirement on your *transform* function. Specifically, transform(op3, compose(op1, transform(op2, op1)) == transform(op3, compose(op2, transform(op1, op2)).\n\n- **tp2**: *(optional)* Boolean property. Make this truthy to declare that the type has tp2 support. Types with TP2 support must define *prune*.\n- **prune(op, otherOp)**: The inverse of transform. Formally, apply(snapshot, op1) == apply(snapshot, prune(transform(op1, op2), op2)). Usually, prune will simply be the inverse of transform and prune(transform(op1, op2), op2) == op1.\n\n\n---\n\n# License\n\nAll code contributed to this repository is licensed under the standard MIT license:\n\nCopyright 2011 ottypes library contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following condition:\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","maintainers":[{"name":"josephg","email":"josephg@gmail.com"},{"name":"nateps","email":"nate@nateps.com"}],"time":{"modified":"2022-06-23T04:18:33.523Z","created":"2013-05-14T00:12:00.648Z","0.6.1":"2013-05-14T00:12:02.527Z","0.6.2":"2013-05-25T02:12:04.900Z","1.0.0alpha":"2013-06-01T20:18:00.851Z","1.0.0":"2013-07-02T19:01:59.760Z","1.0.1":"2013-11-08T01:09:35.394Z","1.0.2":"2014-07-07T21:27:40.351Z","1.0.3":"2015-01-14T02:46:48.862Z"},"author":{"name":"Joseph Gentle","email":"josephg@gmail.com"},"repository":{"type":"git","url":"git://github.com/share/ot-types.git"},"homepage":"https://github.com/share/ot-types","keywords":["OT","operational transformation","transform"],"bugs":{"url":"https://github.com/share/ot-types/issues"},"license":"MIT","readmeFilename":"README.md","users":{"shanewholloway":true}}